This document is archived and information here might be outdated.  Recommended version.

IEditorZ.DrapeGeometry Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Editor > ESRI.ArcGIS.Editor > Interfaces > IE > IEditorZ Interface > IEditorZ.DrapeGeometry Method
ArcGIS Developer Help

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 _
public void DrapeGeometry (
    IGeometry Geometry,
    bool addVertices,
    ref IGeometry outputGeometry

Product Availability

Available with ArcGIS Desktop.


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.

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