Generic Reactor Question

Discussion in 'AutoCAD' started by Steven Craig Basham, Jun 22, 2004.

  1. Hello, I have a quick question regarding reactors:

    I've written a lisp routine to draw qleader(s) and attach them to an
    inserted note block. I planned to add reactors to the notes so that when
    they are moved they will automatically be placed 'in-front' of the leader(s)
    [it has a wipeout built in]. Here's my question: if I successfully attach
    a reactor and it functions properly in the drawing. Will it function again
    after I close the drawing and re-open it?

    I'm still learning about reactors, and I'm not sure of the limitations.
     
    Steven Craig Basham, Jun 22, 2004
    #1
  2. You have to make the reactor persisent and then load the associated lisp files when the drawing is
    opened. Here's how I did it:

    (defun leader_add_reactor
    (tname lname / tent lent vtent vlent exdata)

    (setq vtent (vlax-ename->vla-object tname)
    vlent (vlax-ename->vla-object lname)
    )

    ;; change the draworder of the leader object to "Back" to prevent
    ;; leaderline "jumping" when the reactor fires...
    (command "draworder" lname "" "B")

    ;(princ "\nLeader associated with text object.\n")
    (setq leader_reactor
    (vlr-object-reactor
    (list vlent vtent)
    "Make_Leader"
    '(:)vlr-modified . leader_txt_moved)
    :)vlr-erased . reactor_obj_erased))
    )

    )
    (vlr-pers leader_reactor) ; make it persistent
    )
     
    Allen Johnson, Jun 22, 2004
    #2
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.