Provides access to members that access and manipulate the edit sketch. Note: the IEditSketch interface has been superseded byIEditSketch3. Please consider using the more recent version.
When To Use
The purpose of the IEditSketch interface is to manage a geometry that will be used extensively by the editor. Ultimately, the editor's current task takes the geometry to perform some action; for example, the CreateNewFeature task takes the geometry and stores it in the database as a new feature.
The editor automatically creates a new empty geometry. The type of geometry created is the same as the editor's current layer (IEditor::CurrentLayer ). Use the AddPoint method to build (add data to) the edit sketch geometry and FinishSketch to signal the current task that the geometry is ready for use. To bring an existing feature into the edit sketch, set the Geometry property to the desired feature and call RefreshSketch .
|AddPoint||Adds a point to the edit sketch. If allowUndo is true, a new operation will be created.|
|FinishSketch||Completes the current edit sketch.|
|FinishSketchPart||Completes a part for the current edit sketch.|
|Geometry||Geometry stored in the edit sketch.|
|GeometryType||Type of the geometry stored in the edit sketch.|
|LastPoint||The last point in the edit sketch.|
|ModifySketch||Call to notify listeners that the sketch has been changed.|
|Part||The index of the current part of the sketch.|
|RefreshSketch||Invalidates the portion of the display that is occupied by the sketch.|
|Segment||The index of the current segment of the sketch.|
|Vertex||The index of the current vertex of the sketch.|
CoClasses that implement IEditSketch
|CoClasses and Classes||Description|
|Editor||The Object Editor Extension.|
The IEditSketch interface is on the Editor CoClass.
Edit tasks set the geometry type of the edit sketch, and the sketch tools add points to that geometry. For example, the Create New Feature task sets the edit sketch geometry type to be the same as the geometry type of the target layer. In contrast, the Select Features Using a Line task always sets the edit sketch geometry type to esriGeometryPolyline, with no regard to the current layer geometry type.
Edit tasks often set the edit sketch geometry to esriGeometryNull, causing the sketch tools to become inactive. For example, the Reshape task will set the edit sketch geometry to esriGeometryNull if there are no polygon or polyline features selected. This prevents users from creating an edit sketch that would otherwise do nothing. Edit tasks respond to editor events such as OnSelectionChanged and OnCurrentLayerChanged to accomplish this.
//Used with ICommand::OnCreate()
public IEditor m_editor; public IEditSketch m_editSketch; public IAppication m_application;m_application = hook as IApplication; if (m_appliation == null) return; UID uID = new UID(); uID.Value = "esriEditor.Editor"; m_editor = m_application.FindExtensionByCLSID(uID) as IEditor; if (m_editor == null) return; m_editSketch = m_editor as IEditSketch;
'This sample would already have a reference to hook by using the ICommand::OnCreate() hook parameter
Private m_editor As IEditor Private m_editSketch As IEditSketch UID uID = new UID(); uID.Value = "esriEditor.Editor"; m_editor = m_application.FindExtensionByCLSID(uID) as IEditor; if (m_editor == null) return; m_editSketch = m_editor as IEditSketch;
IDatasetEdit Interface | IDatasetEditInfo Interface | IEditTask.Name Property | Editor Class | ISnapEnvironment Interface | IEditEvents2 Interface | IEditTask.Deactivate Method | IEditAttributeProperties Interface | IEditor Interface | IEditSketch Interface | IEditTask.OnFinishSketch Method | IEditProperties Interface | IEditLayers Interface | IEditTask.Activate Method | IEditTask.OnDeleteSketch Method | IEditEvents Interface | IGeometry Interface | IFeatureClass.ShapeType Property | esriGeometryType Constants