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: 

WD_COPY_WN LISP COMMAND EXAMPLE

4 REPLIES 4
Reply
Message 1 of 5
Nicholas.J.CAD
173 Views, 4 Replies

WD_COPY_WN LISP COMMAND EXAMPLE

I need an example for a Lisp command using "WD_COPY_WN".

For drawing wires I have used (c:WD_WIRE '(6.56250 18.81250 0.) '(5.56250 18.81250 0."").

Trying to use the "WD_COPY_WN" command, I have not been able to make it work.

 

I would appreciate the example to place the wire copy at an exact coordinate, as opposed to using "LAST".

Also, is there a different command similar to "WD_COPY_WM" for horizontal wires? This command seems to only work for vertical wires.

 

One Example of a working command would be much appreciated!

 

(Reposted from AutoCAD Customization Forum)

4 REPLIES 4
Message 2 of 5

"WD_COPY_WN" is (WD ??) Copy Wire Number.

 

NicholasJCAD_0-1661889541529.png

 

 

NicholasJCAD_1-1661889541740.png

 

 

NicholasJCAD_2-1661889541748.png

 

 

NicholasJCAD_3-1661889541741.png

 

 

I have not been able to use this in lisp command form, especially with placement at an exact coordinate.

Message 3 of 5

How about looking into the API help?

 

(c:wd_putwnxy) should do it.
20220830 221718 thlct.png
 

Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 4 of 5

Doing a quick search would show you there is nothing to be found rhesusminus.

 

NicholasJCAD_1-1661891146085.png

This menu often helps, but not today.

 

After the command "WD_COPY_WN" is entered, it asks to select a wire. It does not accept a coordinate here. I am able to command "LAST" but the Wd_wch (wire copy) block is placed  in unappreciated location.

 

I have been reading through the "c:wd_putwn..." commands, although none of these seem to work for wires part of an existing branch with defined wire number (wire copy). 

 

(Really appreciate this find as this may be handy in the future!)

 

 

EDIT: I may be able to take the existing "wd_putwnxy" command and copy it over to a new command, having it check if the wire is on a defined network, and using the found wire number value to place a wire copy block.

 

Message 5 of 5

While the API dont have a command to insert wire number copies, these are the tools you have to automate the process.

 

If you turn on lisp debugging with the command AEONLISPDEBUG you can see the following when inserting a wire number copy:

Command:
Extra Wire Number

<Select wire for Extra wire number copy>:
IN:wd_copy_wirenumber
  IN/OUT:wd_wnet_find_ptr_for_net=
  IN/OUT:wd_1_get_hdl_ptr_xdata VIA_WD_WNPTR=FB2FB2
  IN/OUT:wd_wnum_get_wire_num=506A
IN:wd_sym_insert_elect_block2 WD_WCH
  IN/OUT:wd_lay_adjust_attrib_layers
IN:wd_sed_is_it_schem_or_pnl
OUT:wd_sed_is_it_schem_or_pnl=12
OUT:wd_sym_insert_elect_block2 506A
IN:wd_wnum_move_wnum_if_bump
  IN/OUT:wd_wnum_get_text_box
  IN/OUT:wd_wnum_does_text_bump=nil
OUT:wd_wnum_move_wnum_if_bump
OUT:wd_copy_wirenumber
<Select wire for Extra wire number copy>:*Cancel*

IN:wd_1_cserr
  IN/OUT:wd_dbase_releaseallhandles
OUT:wd_1_cserr
Command:

 

So, it's analyzing the selected wire to find the "main" wire number and extract the wire number value from there. Then it inserts the WD_WCH block (wire number copy), and changes the attribute value of that block.

 

Unfortunately, those commands are undocumented, but sometimes you're able to reverse engineer by trial and failure.


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉

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

Post to forums  

Technology Administrators


AutoCAD Beta