When I load the following I get this: invalid reaction name: :VLR-beginSave
Yet other SAVE reactor code I've seen has had VLR-beginSave in it. So why doesn't AutoCAD like it in my code?
; http://discussion.autodesk.com/thread.jspa?messageID=4814195
(or *CmdReactor*
(setq *CmdReactor*
(VLR-Command-Reactor
nil
'((:VLR-commandWillStart . BrandName_CmdReactor:WillStart)
(:VLR-commandEnded . BrandName_CmdReactor:Ended)
(:VLR-commandCancelled . BrandName_CmdReactor:Canceled)
(:VLR-BeginSave . MyCmdSave)))))
(defun MyCmdSave (Reactor-Object Command-List *activedoc*)
(setq *activedoc* (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))
(vla-sendcommand *activeacaddoc* "properties ") ; Just a test to make sure it worked
(princ)
)
;_ MAKE SURE EXECUTE THIS IN THE END OF AUTOCAD SESSION
(defun BrandName_CleanReactors ()
(setq *CmdReactor* nil)
(mapcar 'VLR-Remove-All
'(:VLR-AcDb-Reactor :VLR-Editor-Reactor :VLR-Linker-Reactor
:VLR-Object-Reactor :VLR-Command-Reactor :VLR-DeepClone-Reactor
:VLR-DocManager-Reactor :VLR-DWG-Reactor :VLR-DXF-Reactor
:VLR-Editor-Reactor :VLR-Insert-Reactor :VLR-Linker-Reactor
:VLR-Lisp-Reactor :VLR-Miscellaneous-Reactor :VLR-Mouse-Reactor
:VLR-Object-Reactor :VLR-SysVar-Reactor :VLR-Toolbar-Reactor
:VLR-Undo-Reactor :VLR-Wblock-Reactor :VLR-Window-Reactor
:VLR-XREF-Reactor))
)
(princ)