AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

N8, please! Can i modify your plcwnum.lsp Routine?

1 REPLY 1
Reply
Message 1 of 2
Alejandro79
513 Views, 1 Reply

N8, please! Can i modify your plcwnum.lsp Routine?

Hi.
I have your routine and is great. Can you get me started on making it more automatic than semi? I would need to grab the whole wire/s and get them all numbered. Kind of selecting with a window or fence.
Thanks!

Regards.
Alex.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Alejandro79

Hi Alex,

Please give it a try.

You want to modify the existing example plcwnum.lsp utility so that you
don't have to pick,pick,pick,pick..., right? You just want to pick on a PLC
I/O module and have it automatically find and insert the I/O address wire
numbers with incrementing suffixes, right? Or maybe you want it to just find
all I/O modules and "just do it" without you having to pick each module? If
so, this won't be real easy but it's not impossible.

There are some key tools in the AcadE "API" documentation that you'll
probably need to use. The main one is this:

(c:wd_get_sym_pntlst ben nozoom usecache)

You pass is the entity name of a PLCIO module block "ben" and it returns a
block of data that includes all wire connections on the module and the
entity name of each wire that ties to each connection. Here is the full list
of what is returned:

Returns
List of lists, one list for each wire connection point carried on the target
entity. For example: (list (list index connection_xyz conn_wire_en_lst nil
suffix xterm_ent_name multi_wire_lst maxcon jumpers_attr_en) (list
index....)) Where :



a.. index = index number (integer).
b.. connection_xyz = XYZ coordinate of the X?TERMxx wire connection
attribute.
c.. nil = for future use.
d.. conn_wire_en_lst = list of entity names of LINE segments that have end
points that touch or "connect to" the wire connection point.
e.. xdir = the "?" character of the X?TERMxx wire connection attribute
(valid values = 0, 1,2,4, or 8).
f.. suffix = the "xx" suffix characters of the X?TERMxx wire connection
attribute (ex: "01").
g.. xterm_en_name = entity name of the X?TERMxx wire connection attribute.
h.. multi_wire_lst = list of entity names of polylines on the
"_MULTI_WIRE" layer that tie into the wire connection point.
i.. maxcon = (future) value of "PREFER_MAXCON" xdata carried on wire
connection attribute.
j.. jumpers_attr_en = (may not be present in the list) - entity name of
WD_JUMPERS attribute (if exists, otherwise this entry is omitted from the
list).
Your interest is "suffix" so that you can find the I/O address text tied to
this wire connection point. For example, if the suffix is "04" for wire
connection attribute X?TERM04, then you take the "04" and look for I/O
address attribute TAGA04. So, now you have the wire number prefix for the
string of devices that tie to this wire connection point that is located at
"connection_xyz".

At this point you can go the easier route of and just throw a narrow
crossing window out from the wire connection point's xy coordinate in the
direction indicated by the wire connection direction "xdir". Grab LINE wires
and then figure out the order of them, distance-wise, and apply the wire
number calls in sequence. The more difficult route but more accurate if your
wires take some turns is to actually follow the connected wire to the next
device, out the other side, and repeat until you hit the common bus.

Nate.




wrote in message news:5082223@discussion.autodesk.com...
Hi.
I have your routine and is great. Can you get me started on making it more
automatic than semi? I would need to grab the whole wire/s and get them all
numbered. Kind of selecting with a window or fence.
Thanks!

Regards.
Alex.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost