ArcObjects Library Reference (Editor)  

IEditorZ.DrapeGeometry Method

Drapes a geometry to the current surface.. If addVertices is false, existing vertex Z's will be modified but no new vertices added.

[Visual Basic .NET]
Public Sub DrapeGeometry ( _
    ByVal Geometry As IGeometry, _
    ByVal addVertices As Boolean, _
    ByRef outputGeometry As IGeometry _
)
[C#]
public void DrapeGeometry (
    IGeometry Geometry,
    bool addVertices,
    ref IGeometry outputGeometry
);

Product Availability

Available with ArcGIS Desktop.

Remarks

Drapes the input geometry on the editor's current surface (defined by IEditorZ::Surface).  If addVertices is FALSE, then only Z values for existing vertices in the input geometry will be updated.  If addVertices is TRUE, then new vertices will be inserted at changes in elevation defined by the surface.   Existing vertices are not updated when addVertices is TRUE.

[C#]
private void DrapeSketch(ESRI.ArcGIS.Editor.IEditor editor)
{ 
  IEditorZ editorZ = m_editor as IEditorZ;
  IEditSketch2 editSketch = (IEditSketch2)m_editor;
  ESRI.ArcGIS.Geometry.IGeometry drapeGeom;
//drape the sketch geometry - only update the existing vertices' Zs editorZ.DrapeGeometry(editSketch.Geometry, false, out drapeGeom); //replace the sketch with the draped geometry editSketch.Geometry = drapeGeom; }

See Also

IEditorZ Interface