TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on October 18, 2011, 11:06:16 AM
-
Hi guys,...
I have some problem with reactor in AutoCAD 2011
for some reason, the CANCEL reactor do not work with PLOT command.
(vlr-remove-all)
(defun *CancelCPLOT* (calling-reactor startcommandInfo / )
(alert "Plot Cancelled")
)
(if cancelCPLOT (progn (vlr-remove cancelCPLOT)(setq cancelCPLOT nil)))
(setq cancelCPLOT (vlr-command-reactor nil '((:vlr-commandCancelled . *CancelCPLOT*))))
strange thing...
that when you cancel the PLOT command it use :vlr-commandEnded against :vlr-commandCancelled
any one have note this issue ?
Thanks.
-
57 views and no suggestions ?
well,..I thougt you was better....LOL ! :)
ok,..just let sharing a workaround..
(vlr-remove-all)
;;;;; ;;
;;;;; LOAD REACTEUR ;;
;;;;; ;;
(defun *startcplot* (calling-reactor startcommandinfo)
(cond ((eq (car startcommandinfo) "PLOT") (alert "Start")))
)
(defun *endcplot* (calling-reactor startcommandinfo)
(if (and (eq (getvar "diastat") 1)
(eq (car startcommandinfo) "PLOT")
)
(alert "End")
(alert "Cancelled")
)
)
(defun loadcplotreactor ()
;;On command Start
(if startcplot
(progn (vlr-remove startcplot) (setq startcplot nil))
)
(setq startcplot (vlr-command-reactor nil
'((:vlr-commandwillstart . *startcplot*))
)
)
;;On command Ended
(if endcplot
(progn (vlr-remove endcplot) (setq endcplot nil))
)
(setq endcplot (vlr-command-reactor nil
'((:vlr-commandended . *endcplot*))
)
)
)
(loadcplotreactor)
I hope this will help some other..
have a good day all !
-
Andrea,
I've just done a quick little test and found the following:
-Cancelling through the plot dialog calls the ended reactor.
-Plotting through the transparent command pressing escape calls the cancelled reactor.
(SETQ *testreactor*
(LIST
(VLR-COMMAND-REACTOR
nil
'(
(:VLR-COMMANDCANCELLED . testing:cancelledreactor)
(:VLR-COMMANDFAILED . testing:failedreactor)
(:VLR-COMMANDENDED . testing:endedreactor)
(:VLR-COMMANDWILLSTART . testing:startingreactor)
)
)
)
)
(DEFUN testing:cancelledreactor (reactor arguments /)
(PRINC "\nCANCELLED")
)
(DEFUN testing:failedreactor (reactor arguments /)
(PRINC "\nFAILED")
)
(DEFUN testing:endedreactor (reactor arguments /)
(PRINC "\nENDED")
)
(DEFUN testing:startingreactor (reactor arguments /)
(PRINC "\nSTARTING")
)