Reactor crash

Discussion in 'AutoCAD' started by Jeff-FRCH, Oct 14, 2004.

  1. Jeff-FRCH

    Jeff-FRCH Guest

    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 . ACTIVEDWG:DOC2BACT)
    :)vlr-documenttobedestroyed . ACTIVEDWG:CLEAN)
    )
    ) ;_ end of vlr-command-reactor
    ) ;_ end of setq
    ) ;_ end of if

    (defun ACTIVEDWG:DOC2BACT (reactor docmgr-list)
    (if *test-client*
    (setvar "modemacro" (strcat "Client: " *test-client*))
    (setvar "modemacro" "")
    ) ;_ end of if
    ) ;_ end of defun - ACTIVEDWG:DOC2BACT

    (defun ACTIVEDWG:CLEAN (reactor command-list)
    (setq *docmanagerReactor* nil)
    (mapcar 'vlr-remove-all '(vlr-docmanager-reactor))
    ) ;_ end of defun - ACTIVEDWG:CLEAN
     
    Jeff-FRCH, Oct 14, 2004
    #1
  2. Jeff-FRCH

    MP Guest

    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?
     
    MP, Oct 14, 2004
    #2
  3. Jeff-FRCH

    Jürg Menzi Guest

    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
     
    Jürg Menzi, Oct 14, 2004
    #3
  4. Jeff-FRCH

    Jeff-FRCH Guest

    Still crashes. The program runs fine with setvar or with vla-setvariable but the VLIDE crashes either way. Thanks for the reply.
     
    Jeff-FRCH, Oct 14, 2004
    #4
  5. Jeff-FRCH

    Jeff-FRCH Guest

    Thanks for the help but it didn't fix the problem. Everything runs fine until I open the VLIDE.
     
    Jeff-FRCH, Oct 14, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.