This document is archived and information here might be outdated. Recommended version. |
Provides access to members that control undo/redo capabilities for edit sketch modifications.
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.
Name | 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 text that appears in the undo menu choice. | |
MenuString | The menu string. | |
Redo | Redoes the operation. | |
Start | Starts the operation, caching the existing sketch. Call this before modifying the sketch. | |
Undo | Undoes the operation. |
Interfaces | Description |
---|---|
IOperation | Provides access to members that control Operations. |
Classes | Description |
---|---|
SketchOperation | Provides undo/redo capabilities for edit sketch modifications. |
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...
IEditor Interface | IEditAttributeProperties Interface | IEnvelope Interface | IOperation Interface