Reactors! Can someone look?

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

  1. Hi,
    I thought I added my reactor code correctly... but I keep getting a ";
    error: too many arguments" error. Can someone take a look at my snipit and
    tell me what I did wrong?

    (...
    (setq NOBJ (entget (entlast)))
    (setq vlNOBJ (vlax-ename->vla-object (cdr(car nobj))))
    (setq note_reactor (vlr-object-reactor (list vlNOBJ) "Note Reactor"
    '(:)vlr-modified . note_moved))))
    (vlr-pers note_reactor)
    (command "QLATTACH" (cdr(car lobj))(cdr(car nobj))) <<<<<--- I believe
    this is where I dumping the error. Which makes no sense to me.. I would
    have thought 2 lines above was the culprit.
    ....)
    (defun Note_moved ()
    (prompt "Note Moved!")
    )

    Thanks for your help!
     
    Steven Craig Basham, Jun 22, 2004
    #1
  2. Steven Craig Basham

    ECCAD Guest

    (command "QLATTACH" (cdr(car lobj))(cdr(car nobj)))
    is a problem. Variable nobj is an entity definition. I think you need
    to setq something to (cdr (car (assoc ?? nobj))) .. instead of
    passing the entity list to 'qlattach' ?

    Bob
     
    ECCAD, Jun 22, 2004
    #2
  3. Hmm... the interesting thing about it is this: The (command "qlattach"... )
    worked perfectly until I added the reactor code lines above it... if I
    comment the reactor lines out it still works as expected. Do you think I
    misdefined (vl-object-reactor ... ) Line?
     
    Steven Craig Basham, Jun 22, 2004
    #3
  4. Okay! I got it... I didn't realize that my :)vlr-modified . Note_Moved)
    call actually requires me to accept 3 parameters in the corresponding
    Note_Moved function. DOH!

    If anyone is still reading this (as I hope you are)... how do I check for 1
    specific modification? I.E.: The object was moved...

    Thanks for your support!
     
    Steven Craig Basham, Jun 22, 2004
    #4
  5. Steven Craig Basham

    BillZ Guest

    how do I check for 1
    specific modification? I.E.: The object was moved...
    <<<

    I'm not an expert at reactors but I would think that you could check the location of the object after the modification is closed.

    Here is a snip from what I have been experimenting with a point object:

    (setq PointReactor1 (vlr-object-reactor (list Point1)
    "Point Reactor" '(:)vlr-objectClosed . point-manipulate))
    )

    Then:

    (defun point-manipulate (notifier-object reactor-object parameter-list)
    (vl-load-com)
    (cond ((= (vlr-current-reaction-name) ':VLR-objectClosed)
    (if (and (vlax-property-available-p
    notifier-object
    "Coordinates" t)
    (not (vlax-erased-p notifier-object))
    )
    (progn
    (princ "\nThe Location is ")
    (princ (vlax-safearray->list (vlax-variant-value (vla-get-coordinates notifier-object))))
    )
    ) ;end if.
    )
    ) ;end first cond.
    )

    It probably isn't the only way to do it.

    HTH

    Bill
     
    BillZ, Jun 23, 2004
    #5
  6. If you are modifying the leader line to adjust to the new text point, just look at the new insertion
    point of the text object and recalculate the leader points to make it align with the current text
    insertion point.

    If you are interested, I can send you my leader reactor code.
     
    Allen Johnson, Jun 23, 2004
    #6
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.