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


IEngineSketchOperation Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Controls)  

IEngineSketchOperation Interface

Provides access to members that control undo/redo capabilities for edit sketch modifications.

Product Availability

Available with ArcGIS Engine.

Description

This interface is new at ArcGIS 9.3.

Use sketch operations to provide undo and redo capabilities when making modifications to the engine edit sketch. For example, if you wanted to insert a new point in the middle of the edit sketch, create a sketch operation so the edit can be undone. IEngineSketchOperation derives from IOperation giving these additional methods: CanRedo, CanUndo, Do, Redo, Undo. When undoing a sketch operation use either the IEngineSketchOperation::Undo method or the IOperationStack::Undo method available from the IToolbarControl::OperationStack property. Do not mix these 2 approaches.

Engine sketch operations are very similar to engine edit operations. First, call the Start method to flag the beginning of the sketch operation. Use the MenuString property to give the operation a name. Perform the edits. Call Finish to complete the sketch operation.

The Finish method allows tools to give more information about what they modified; typically, the edited sketch point is passed back to clients listening to engine editor events (IEngineEditEvents). For example, if a point is deleted from an edit sketch and IEngineSketchOperation::Finish is used to complete the operation, the deleted point is passed to the clients responding to IEngineEditEvents::OnVertexDeleted.

Members

Description
Read-only property CanRedo Indicates if the operation can be redone.
Read-only property CanUndo Indicates if the operation can be undone.
Method Do Performs the operation.
Method Finish Finishes the sketch operation and puts it into the operation stack. Call this after the sketch has been modified.
Read-only property MenuString The menu string.
Method Redo Redoes the operation.
Method SetMenuString Sets the text that appears in the undo menu choice.
Method Start Starts the sketch operation and caches the existing sketch. Call this before modifying the sketch.
Method Undo Undoes the operation.

Inherited Interfaces

Interfaces Description
IOperation Provides access to members that control Operations.

CoClasses that implement IEngineSketchOperation

CoClasses and Classes Description
EngineSketchOperation Provides undo/redo capabilities for edit sketch modifications.

.NET Samples

Custom vertex editing commands (Code Files: CustomVertexCommands)

.NET Related Topics

How to create a sketch operation