A reactor can be modified using the reactor object that is returned after a reactor has been created.
The following functions are provided to modify a reactor object:
vlr-reaction-set - Changes the callback function link for the specified reactor event. The function syntax is:
(vlr-reaction-set reactor callback-condition 'callback-function)
For example, the following command changes the circleReactor reactor to call the print-area function when an object is modified:
(vlr-reaction-set circleReactor :vlr-modified 'print-area) PRINT-AREA
vlr-data-set - Changes the application-specific data associated with the reactor. For example, the following call replaces the text string used to identify the circleReactor reactor:
(vlr-data-set circleReactor "Circle Area Reactor") "Circle Area Reactor"
You can verify that the reactor has changed by using the Visual LISP Inspect feature. If the Inspect window is displayed when inspecting your reactor, you might need to update the value displayed by right-clicking in the window's object line and clicking Update.
vlr-owner-add - Adds a database object to the list of owners of the specified reactor. In the following example, an Arc object named archie is added to the owner list of reactor circleReactor:
(vlr-owner-add circleReactor archie) #<VLA-OBJECT IAcadArc 03ad0bcc>
Now, if a user modifies the archie object, the callback function defined for reactor circleReactor is invoked. You can verify this by inspecting the reactor. Update the Inspect window for the circleReactor reactor, then right-click on the list item that begins with {Owners} and click Inspect. Both the Arc and Circle objects are listed in the Inspect window.
vlr-owner-remove - Removes an Owner object from the list of reactor owners. For example, the following statement removes archie from the circleReactor owner list:
(vlr-owner-remove circleReactor archie) #<VLA-OBJECT IAcadArc 03ad0bcc>