AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

Reply
Contributor
MReed
Posts: 21
Registered: ‎06-30-2004
Message 1 of 6 (166 Views)

Wire Labelling

166 Views, 5 Replies
06-30-2004 11:33 AM
I'm trying to auto label my wires using a unique system (the device name as a wire name).
Does anyone know how to change the settings to do this automatically?
Distinguished Contributor
rstein
Posts: 143
Registered: ‎03-19-2004
Message 2 of 6 (166 Views)

Re: Wire Labelling

06-30-2004 11:56 AM in reply to: MReed
I understand what your question is, but I don't think it will work. How would AutoCAD Electrical know which device in the wire network would be the one to take the device name from. for example you could have 3 items in 1 wire network. how would it know to take one over the other. I will look into this tonight to see if i can find a work around for it.

Thanks
Rob Stein
*Expert Elite*
testsubject
Posts: 1,104
Registered: ‎03-09-2004
Message 3 of 6 (166 Views)

Re: Wire Labelling

06-30-2004 12:02 PM in reply to: MReed
As far as I know, that is not possible to do automatically. The wiring module does not know which end to use for the Wire Number Prefix. You can force it to use a specific component by overriding the default settings and picking all the wires that are affected, but that is not automatic.


Sorry that I did not have the answer you were looking for.

Robert Hanrahan
Weight Right Automatic Scale Co.
ACE User since 1997
Bob Hanrahan
Ace User since 1998
Contributor
MReed
Posts: 21
Registered: ‎06-30-2004
Message 4 of 6 (166 Views)

Re: Wire Labelling

07-01-2004 06:40 AM in reply to: MReed
Thanks for your help, at least it's just not me that couldn't figure a way to do this. Have to convince everyone that is not a conventional method
Distinguished Contributor
rstein
Posts: 143
Registered: ‎03-19-2004
Message 5 of 6 (166 Views)

Re: Wire Labelling

07-01-2004 06:42 AM in reply to: MReed
I was unable to find any automatic work around at this point. you might be able to write a custom program using vb or lisp that will read the tag device name (tag1) from the device block and place that in as the wire number. but i think it would still be a matter of click the wire you want to number then clicking the device you want the wire to be named after. so it would not be 100% automatic.

Thanks
Rob Stein
*Nate Holt
Message 6 of 6 (166 Views)

Re: Wire Labelling based upon connected component names- sample utility

07-01-2004 01:09 PM in reply to: MReed
Here is a sample AutoLisp utility that will generate a "fixed" wire number based upon the tag name and pin number of devices connected at each end of a wire segment. This only works for situations where there are two devices, though you could probably enhance it to build wire numbers where there were more than two connected devices. If you wanted to get fancy, you could make this utilty work "drawing wide" or even "project wide". To use: make sure AcadE is "awake". APPLOAD this utility. Type milnum [Enter] at command line to execute. (defun c:milnum ( / en ed x compconlst comp1_en comp2_en pin1 pin2 new_wireno netlst str comp1_tag comp2_tag xterm1_en xterm2_en) (while (setq x (entsel "\nSelect wire for special MIL wire number format:")) (setq en (car x)) (setq ed (entget en)) (if (= (cdr (assoc 0 ed)) "LINE") (progn ; okay to continue (if (setq netlst (c:wd_get_wire_netlst en 1)) (progn (setq compconlst (nth 9 netlst)) (cond ((= (length compconlst) 2) ; two connected components, okay to continue (setq comp1_en (car (car compconlst))) (setq comp2_en (car (cadr compconlst))) (setq xterm1_en (cadr (car compconlst))) (setq xterm2_en (cadr (cadr compconlst))) ; Get the suffix of the first component's X?TERMxx attrib (setq str (cdr (assoc 2 (entget xterm1_en)))) ; Get PIN number of first component (setq pin1 (c:wd_getattrval comp1_en (strcat "TERM" (substr str 7)))) (if (AND (not pin1) (c:wd_getattrval comp1_en "TAGSTRIP")) ; Terminal symbol, just grab the TERM01 terminal number (setq pin1 (c:wd_getattrval comp1_en "TERM01"))) ; Get the suffix of the 2nd component's X?TERMxx attrib (setq str (cdr (assoc 2 (entget xterm2_en)))) ; Get PIN number of first component (setq pin2 (c:wd_getattrval comp2_en (strcat "TERM" (substr str 7)))) (if (AND (not pin2) (c:wd_getattrval comp2_en "TAGSTRIP")) ; Terminal symbol, just grab the TERM01 terminal number (setq pin2 (c:wd_getattrval comp2_en "TERM01"))) ; Get tag of the two components (setq comp1_tag (c:wd_getattrval comp1_en "TAG1*,TAG2*,TAGSTRIP,TAG,TAG_*")) (setq comp2_tag (c:wd_getattrval comp2_en "TAG1*,TAG2*,TAGSTRIP,TAG,TAG_*")) (if (not comp1_tag)(setq comp1_tag "")) (if (not comp2_tag)(setq comp2_tag "")) (setq new_wireno comp1_tag) (if (AND pin1 (/= pin1 ""))(setq new_wireno (strcat new_wireno "-" pin1))) (setq new_wireno (strcat new_wireno "/" comp2_tag)) (if (AND pin2 (/= pin2 ""))(setq new_wireno (strcat new_wireno "-" pin2))) (c:wd_putwnf en new_wireno) ; put the wire number on wire ) (T (princ "\n other than two connected components\n")) ) ) ) ) ) ) (princ) ) "MReed" wrote in message news:15217154.1088689239570.JavaMail.jive@jiveforum2.autodesk.com... > Thanks for your help, at least it's just not me that couldn't figure a way to do this. Have to convince everyone that is not a conventional method
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
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.

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.