AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

Reply
Active Member
Jchrobak
Posts: 7
Registered: ‎02-18-2005
Message 1 of 3 (78 Views)

API insert componet

78 Views, 2 Replies
06-13-2005 08:52 AM
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))

(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))

)

Thanks for any help

Joe
*Nate Holt \(Autodesk\)
Message 2 of 3 (78 Views)

Re: API insert componet

06-13-2005 10:11 AM in reply to: Jchrobak
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
Active Member
Jchrobak
Posts: 7
Registered: ‎02-18-2005
Message 3 of 3 (78 Views)

Re: API insert componet

06-13-2005 12:48 PM in reply to: Jchrobak
Nate
That worked fine. I changed the sigcode value to match some source signals that I have inserted in my test drawing but the cross ref and wire number are not updating.
I placed the following API call after the Modattrval calls
(c:wd_retag_update_noprompts 1 DEST)
Am I using this call correctly?

Or is there a different call to use. when I click on the dest arrow and right click for the retag/update it works
Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.