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)
"WD_COPY_WN" is (WD ??) Copy Wire Number.
I have not been able to use this in lisp command form, especially with placement at an exact coordinate.
How about looking into the API help?
Doing a quick search would show you there is nothing to be found rhesusminus.
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.
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.
Can't find what you're looking for? Ask the community or share your knowledge.