Joe,
You're on the right track. Your call to (c:wd_insym2...), if successful,
should return the entity name of the destination signal arrow symbol. You
can then call the (c:wd_modattrval ...) function to push new attribute
values on to it. I've roughed in a couple lines below. See if this gets you
a bit further along.
Nate.
wrote in message news:4873186@discussion.autodesk.com...
I am writing a routine to draw a horizontal wire from the L1and L2 power
rails at the top of the ladder and insert a destination signal on each.
Is there a way to insert the signal code and description
with the call?
I currently have the options bit set to 1 to open the edit/insert
dialog box.
Does anyone have any idea's or a better way to do something like this?
Here is the code I have so far.
It's not pretty but it seems to work so far.
(DEFUN C:TO_FROM ()
-OSNAP END
(SETQ L1 (GETPOINT "\nSELECT STARTING L1 COLUMN POINT: "))
(SETQ L2 (GETPOINT "\nSELECT STARTING L2 COLUMN POINT: "))
(SETQ LD 2.5)
(SETQ L1STRTX (CAR L1))
(SETQ L1STRTY (CADR L1))
(SETQ L1ENDPTX (+ LD L1STRTX))
(setq L1pt3 (list L1ENDPTX L1STRTY))
(c:wd_wire L1 L1PT3 "WIRES")
(setq DEST (c:wd_insym2 "HA1D1" L1PT3 nil 1))
(if DEST
(progn ; signal arrow successfully inserted. Annotate its attributes
with some values.
(c:wd_modattrval DEST "SIGCODE" "HOT_WIRE" nil)
(c:wd_modattrval DEST "DESC1" "120VAC HOT - From power panel LP1"
nil)
) )
(SETQ L2STRTX (CAR L2))
(SETQ L2STRTY (CADR L2))
(SETQ L2ENDPTX (- L2STRTX LD))
(setq L2pt3 (list L2ENDPTX L2STRTY))
(c:wd_wire L2 L2PT3 "WIRES")
(setq new_entname (c:wd_insym2 "HA1D3" L2PT3 nil 1))
(if new_entname
(progn ; signal arrow successfully inserted. Annotate its attributes
with some values.
(c:wd_modattrval new_entname "SIGCODE" "NEUTRAL_WIRE" nil)
(c:wd_modattrval new_entname "DESC1" "120VAC neutral - From power
panel LP1" nil)
) )
)
Thanks for any help
Joe