The current implementation of AutoLISP supports working in one drawing document at a time. Some AutoCAD APIs, such as ObjectARX and VBA, do support the ability of an application to work simultaneously in multiple documents. As a result, an application may modify an open drawing that is not currently active. This is not supported in AutoLISP. (Note that a VLX may run in a separate-namespace from the document it is loaded from, but it is still associated with that document and cannot manipulate objects in another document.)
vlr-set-notification function.
AutoLISP does provide limited support for reactor callback functions executing in a document that is not active. By default, a reactor callback function will execute only if a notification event occurs when the document it was defined in is the active document. You can alter this behavior using theTo specify that a reactor should execute its callback function even if the document it was defined in is not active (for example, if an application in another namespace triggers an event), issue the following function call:
(vlr-set-notification reactor-object 'all-documents)
To modify a reactor so it only executes its callback function if an event occurs when the document it was defined in is active, issue the following:
(vlr-set-notification reactor-object 'active-document-only)
vlr-set-notification function returns the specified reactor object. For example, the following sequence of commands defines a reactor and sets it to respond to events whether or not its associated document is active:
The_$ (setq circleReactor (vlr-object-reactor (list myCircle)
"Circle Reactor" '((:vlr-modified . print-radius))))
#<VLR-Object-Reactor>
_$ (vlr-set-notification circleReactor 'all-documents)
#<VLR-Object-Reactor>
vlr-notification function. For example:
To determine the notification setting of a reactor, use the_$ (vlr-notification circleReactor)
all-documents
vlr-set-notification function affects only the specified reactor. All reactors are created with the default notification set to active-document-only.
The