VCEndOperation


Version:

1.2, Superseded in 6.0 - See Notes.

Description:

Marks an operation where an undo level ends.

Declaration:

 

C/C++

extern "C" void WINAPI VCEndOperation(short* iError);

Delphi

procedure VCEndOperation(var iError: Smallint); stdcall;

ActiveX/COM

Sub EndOperation()

Parameters:

No additional parameters are used with this subroutine.

Notes:

The functions VCBeginOperation, VCEndOperation, and VCAbortOperation have been superseded by new API functions to handle undo, redo, and user tool database operations. See Magaging Undo and Redo. New tools written for VCADD version 6 and later should use the new API. The old VCBeginOperation, VCEndOperation, and VCAbortOperation are being maintained for legacy purposes, but may be unsupported in the future.

Visual CADD™ provides a set of user tool functions to build and create tools not directly supported in the interface. For example, a multi-line tool that automatically hatches or fills the segments. Since this tool is not provided directly in the Visual CADD™ interface, it must be created through code to interact with the existing commands such as snaps and undo operations. In order for the tools to respond appropriately to undo operations it should set undo and redo levels during the operation. A complex entity tool, one that adds multiple entities such as the multi-line example, can allow each individual entity or instead the entire operation to be undone with a single user undo operation. This depends on the design criteria specified for the application. The level of undo is set with the VCBeginOperation and VCEndOperation API routines. An application should set the beginning of the undo level prior to adding any entities to the drawing database and finish the tool with an end operation. In certain situations, the tool may be aborted by the user typically by pressing the <ESC> key. An application should respond appropriately by aborting the undo level to return it to the state prior to the user tool operation. VCAbortOperation will handle this for the application. When used in conjunction with VCBeginOperation and VCEndOperation, VCAbortOperation will discard all undo information complied since the last VCBeginOperation. The VCEndOperation should be used to mark the end of an undo level if the tool completes as designed, while the VCAbortOperation should be used when the tool ends unexpectedly or if the user manually aborts the tool. VCAbortOperation ensures that there is no residual undo information left.

See Also:

VCBeginOperation