Document level events are persistent in AutoCAD VBA. That is, they are automatically enabled when a VBA project is loaded. However, they are not enabled for any other controller, such as VB. Document level events must therefore be enabled for all other ActiveX Automation controllers.
Once the document level events are enabled, you have a wide range of events available to you. These events include
Triggered when a Document window is activated.
Triggered just after a request is received to close a drawing.
Triggered immediately after a command is issued, but before it completes.
Triggered after the user double-clicks on an object in the drawing.
Triggered immediately after AutoCAD receives a request to evaluate a LISP expression.
Triggered immediately after AutoCAD receives a request to print a drawing.
Triggered after the user right-clicks on the Drawing window.
Triggered immediately after AutoCAD receives a request to save the drawing.
Triggered after the user right-clicks on the Drawing window, and before the shortcut menu appears in Command mode.
Triggered after the user right-clicks on the Drawing window, and before the shortcut menu appears in Default mode.
Triggered after the user right-clicks on the Drawing window, and before the shortcut menu appears in Edit mode.
Triggered after the user right-clicks on the Drawing window, and before the shortcut menu appears in Grip mode.
Triggered after the user right-clicks on the Drawing window, and before the shortcut menu appears in Osnap mode.
Triggered when the Drawing window is deactivated.
Triggered immediately after a command completes.
Triggered upon completion of evaluating a LISP expression.
Triggered after a document has been sent to the printer.
Triggered when AutoCAD has finished saving the drawing.
Triggered after the shortcut menu appears.
Triggered after the user switches to a different layout.
Triggered when the evaluation of a LISP expression is canceled.
Triggered when an object has been added to the drawing.
Triggered when an object has been erased from the drawing.
Triggered when an object in the drawing has been modified.
Triggered when the current pickfirst selection set changes.
Triggered when there is a change to the Document window.
Triggered just after the Drawing window has been moved or resized.