Provides access to members that control undo/redo capabilities for edit sketch modifications.
Product Availability
When To Use
Use sketch operations to provide undo and redo capabilities when making modifications to the 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.
ISketchOperation derives from IOperation giving these additional methods: CanRedo, CanUndo, Do, Redo, Undo.
Members
Description | ||
---|---|---|
CanRedo | Indicates if the operation can be redone. | |
CanUndo | Indicates if the operation can be undone. | |
Do | Performs the operation. | |
Finish | Finishes the operation and puts it into the operation stack. Call this after the sketch has been modified. | |
MenuString | The menu string. | |
MenuString | The text that appears in the undo menu choice. | |
Redo | Redoes the operation. | |
Start | Starts the operation, caching the existing sketch. Call this before modifying the sketch. | |
Undo | Undoes the operation. |
Inherited Interfaces
Interfaces | Description |
---|---|
IOperation | Provides access to members that control Operations. |
CoClasses that implement ISketchOperation
CoClasses and Classes | Description |
---|---|
SketchOperation | Provides undo/redo capabilities for edit sketch modifications. |
Remarks
Sketch operations are very similar to Editor operations.
First, call Start 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 edit operation. Finish
requires an envelope parameter that is used to invalidate/refresh
the display.
The follwing code can be used
in the ICommand::OnClick method before the sketch operation.
The editor was declared as a class field and set in the OnCreate
method.
...
m_editor.StartOperation();
ISketchOperation sketchOperation = new
SketchOperationClass();
sketchOperation.MenuString_2 =
"specificSketchOperation";
sketchOperation.Start(m_editor);
//do sketchOperation...
See Also
IEditAttributeProperties Interface | IEnvelope Interface | IOperation Interface