Each reactor type supports numerous events that cause that particular reactor to call an application. For example, when a command is issued at the command prompt, AutoCAD responds with a :VLR-commandWillStart event. Likewise, when the user cancels a command, AutoCAD responds by issuing a :VLR-commandCancelled event. The events associated with a reactor type are known as callback events. Their main purpose is to call the function associated with that particular event. The exact action that will be monitored must be determined first because it will determine which callback function will be selected.
Returning a List of Available Events
A list of available events can be generated for a particular reactor type through the AutoLISP function vlr-reactor-names (vlr-reaction-names reactor type). This function has only one required argument, the reactor type or reactor object for a list of events. For example, to generate a list of events associated with document reactors, the following expression would be used.
_$ (VLR-REACTION-NAMES :VLR-DocManager-Reactor) enter
(
:VLR-documentCreated
:VLR-documentToBeDestroyed
:VLR-documentLockModeWillChange
:VLR-documentLockModeChangeVetoed
:VLR-documentLockModeChanged
:VLR-documentBecameCurrent
:VLR-documentToBeActivated
:VLR-documentToBeDeactivated
)
Note: A list of all available reactor events is provided in the appendix as well as in the AutoLISP Reference Guide.
Caution: Make sure that the extended AutoLISP functions have been loaded into memory with the vl-load-com function before issuing vlr-reaction-names or any other reactor function. Otherwise an error will result with AutoLISP displaying the following message "no function definition".
No comments:
Post a Comment