The following reactor code simply sets the modemacro system variable to "Client: XXXX" where XXXX is the name of the client stored in a global variable named *test-client*. It seems to run fine until I open the VLISP IDE. The drawing window in AutoCAD immediately becomes unresponsive but I can still change drawings and work in the VLIDE window. I have to close AutoCAD with Task Manager. Is there anything in my code that is causing the problem or is this just a bug? Windows XP with ADT2002 or ADT2004 (vl-load-com) (if (not *docmanagerReactor*) (setq *docmanagerReactor* (vlr-docmanager-reactor nil '(vlr-documenttobeactivated . ACTIVEDWGOC2BACT) vlr-documenttobedestroyed . ACTIVEDWG:CLEAN) ) ) ;_ end of vlr-command-reactor ) ;_ end of setq ) ;_ end of if (defun ACTIVEDWGOC2BACT (reactor docmgr-list) (if *test-client* (setvar "modemacro" (strcat "Client: " *test-client*)) (setvar "modemacro" "") ) ;_ end of if ) ;_ end of defun - ACTIVEDWGOC2BACT (defun ACTIVEDWG:CLEAN (reactor command-list) (setq *docmanagerReactor* nil) (mapcar 'vlr-remove-all '(vlr-docmanager-reactor)) ) ;_ end of defun - ACTIVEDWG:CLEAN
if i remember correctly, setvar is one of the things to avoid in reactor callbacks iirc, use vla-setvariable instead ;;;(vla-setvariable (vla-get-activedocument (vlax-get-acad-object)) variableName Value) ;;;(vla-getvariable (vla-get-activedocument (vlax-get-acad-object)) variableName) hth Mark "Client: XXXX" where XXXX is the name of the client stored in a global variable named *test-client*. It seems to run fine until I open the VLISP IDE. The drawing window in AutoCAD immediately becomes unresponsive but I can still change drawings and work in the VLIDE window. I have to close AutoCAD with Task Manager. Is there anything in my code that is causing the problem or is this just a bug?
Hi Jeff Guess the problem can be solved like this: Code: (defun ACTIVEDWG:CLEAN (reactor command-list) (mapcar 'VLR-remove (list *docmanagerReactor*)) (setq *docmanagerReactor* nil) (princ) ) ;_ end of defun - ACTIVEDWG:CLEAN Cheers
Still crashes. The program runs fine with setvar or with vla-setvariable but the VLIDE crashes either way. Thanks for the reply.