Reactors

Discussion in 'AutoCAD' started by Walt Engle, Mar 28, 2005.

  1. Walt Engle

    Walt Engle Guest

    I need some help from experienced users. I have inserted the reactor
    (below) into my acad.lsp file. It does not work as I expected. This is
    my first attempt to use reactors, so obviously I am missing something.
    Can someone point me in the right direction?
    Note: I took the items listed from Cadalyst hoping when I save a dwg it
    would zoom to extents and delete any unused objects/layers. TIA

    (vl-load-com)
    (setq MyReactor1
    (vlr-dwg-reactor
    ;nil
    '(:)vlr-BeginSave . DoThisBeforeSave)
    )
    )
    )
    (defun DoThisBeforeSave (Caller CmdSet)
    (alert "You are about to save this drawing!")
    (princ)
    )
    (defun DoThisBeforeSave (caller CmdSet)
    (command ".zoom" "e")
    )
    (defun DoThisBeforeSave (caller CmdSet)
    (command "-purge" "a" "*" "n")
    (princ)
    )
     
    Walt Engle, Mar 28, 2005
    #1
  2. I guess the function "DoThisBeforeSave" must be placed before "setq
    MyReactor1" also it shoudn't be defined 3 times. And the most important
    thing - reactor must be deactivated after it's finished, otherwise it won't
    work properly and moreover ACad may even crash.
     
    Koistya `Navin \(TechProject\), Mar 28, 2005
    #2
  3. I read about that sample from the original author and the whole article and is wrong.

    To start, in the callback functions you do not use the COMMAND calls.

    Second, it does not work the zoom extents on the drawing, there is something else that needs to be done.

    LE.
     
    Luis Esquivel, Mar 28, 2005
    #3
  4. Walt Engle

    Walt Engle Guest

    Thanks - Luis helped me so it is a moot question now.
     
    Walt Engle, Mar 28, 2005
    #4
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.