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


IEditSketchExtension2.CreateSketchGeometry Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Editor)  

IEditSketchExtension2.CreateSketchGeometry Method

The geometry that will be used in the sketch when modifying a feature.

[Visual Basic .NET]
Public Function CreateSketchGeometry ( _
    ByVal feature As IFeature _
) As IGeometry
[C#]
public IGeometry CreateSketchGeometry (
    IFeature feature
);

Product Availability

Available with ArcGIS Desktop.

Remarks

Use this method when either 1) modifying an existing feature's geometry or 2) creating a new geometry for the EditSketch to use initially.

You can start with the geometry of the feature you have been given the reference to, possibly modify it, and pass it back out -or- create a completely new geometry for intial use by the EditSketch.

This is primarily used in conjunction with the modify task.

[C#]
public IGeometry CreateSketchGeometry(ESRI.ArcGIS.Geodatabase.IFeature feature)
{
  if (feature != null)
    return feature.Shape;
  else
    return null;
}
[Visual Basic .NET]
Public Function CreateSketchGeometry(ByVal feature As ESRI.ArcGIS.Geodatabase.IFeature) As IGeometry
  If Not feature Is Nothing Then
    Return feature.Shape
  Else 
    Return Nothing
  End If
End Function

See Also

IEditSketchExtension2 Interface | IDatasetEdit Interface | IDatasetEditInfo Interface | IEditSketch Interface | IEditTask.Activate Method | IEditor Interface | IEditTask.Deactivate Method | ISnapEnvironment Interface | IEditEvents2 Interface | IEditLayers Interface | IEditEvents Interface | IEditTask.Name Property | Editor Class | Editor Library | IEditTask.OnFinishSketch Method | IEditAttributeProperties Interface | IEditTask.OnDeleteSketch Method | IEditProperties Interface | IExtension Interface