Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

WD_COPY_WN LISP COMMAND EXAMPLE

9 REPLIES 9
Reply
Message 1 of 10
Nicholas.J.CAD
340 Views, 9 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!

9 REPLIES 9
Message 2 of 10

What is the "WD_COPY_WN" command?  This Topic is the only occurrence of that in a Search of all the Autodesk Forums.  "WD_WIRE" seems to be an AutoCAD Electrical specialty function -- is "WD_COPY_WN" another, and should you inquire over in the >Forum for that<?

Kent Cooper, AIA
Message 3 of 10

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

 

NicholasJCAD_0-1661888302011.png

 

NicholasJCAD_1-1661888415561.png

 

NicholasJCAD_3-1661888494367.png

 

NicholasJCAD_4-1661888514748.png

 

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

 

 

 

 

 

 

 

 

Message 4 of 10
Sea-Haven
in reply to: Nicholas.J.CAD

Like Kent is it something in "Acad Electrical" or is it custom lisps ? Never seen before, you need to confirm.

Message 5 of 10

At the first time you use it in a given drawing, does a message go by like "Initializing..."?  That happens when an Express Tool, or an AutoLisp-defined custom command pre-loaded with (autoload), is first used.  It indicates [if you're watching] that it is not a native AutoCAD command.  If that's the case:

1.  You can't use it in an AutoLisp (command) function, which will only accept native AutoCAD command names;

2.  You need to find what is (load)ing or (autoload)ing it [very likely it's in an acaddoc.lsp file, but there are other possibilities].  If that leads you to the code that defines it, maybe that can be adjusted for your needs.

Kent Cooper, AIA
Message 6 of 10

These Commands are "native" to AutoCAD Electrical. The Wires have Wire Number Blocks that define the Wire Number for each Wire. These Definitions are attached to Wire Number Blocks (in green in the Example). Wire Copy Numbers refer to the Wire Number Blocks to know what each Wires' Number is. 

 

I am producing a LISP/DCL that generates one Schematic Sheet for a Part our Company uses frequently. The Program works almost entirely, the only things missing are the Wire Numbers and Wire Copy Numbers.

 

The Wire Numbers may be able to be added with the "wd_putwnxy" native AutoCAD Electrical Command. I am not positive as I have not tested it as of yet. However, this Command allows for Coordinates to be used, hence the "...xy".

 

My issue is with the Copy, as it asks for an Entity to be chosen. When this is done manually, the Block is placed near to where the user clicks each Wire. When the Command is used in a LISP, I have only been able to select the Wire I want by using "Entlast". This places the Wire Copy Block in a terrible Location essentially.

 

(Thank you Guys for your Time b.t.w)

Message 7 of 10


@Nicholas.J.CAD wrote:

These Commands are "native" to AutoCAD Electrical. ....


Are you sure?  They may be automatically defined for you in it, but that doesn't mean they're native AutoCAD commands.  For example, I have a custom command called MM [for Make More, which predates but also does more than the later AutoCAD ADDSELECTED command], which is (autoload)ed in every drawing.  If I type in the first M and the auto-complete pop-up offers possibilities to choose from, the first is Move for which M is the standard command alias, and it offers my MM, and other things:

Kent1Cooper_0-1662468901531.png

Note that the native AutoCAD commands all have icons to their left, but my custom MM command does not.  Neither do any of the WD_COPY... command options in your image, which makes me suspect they are likewise not native.

 

If you type it in an AutoLisp call:  (command "_.WD_COPY_WN"), does it start the command and leave you in it, or do you get an unknown-command message?

 

In a new drawing in which you have not yet used any of those WD_COPY... commands, when you first type in the name of one of them, what does the command-line history show?  If  Initializing...  goes by, it's not a native AutoCAD command, but is (autoload)ed.  [If it doesn't say that, they could still be non-native, but outright (load)ed rather than (autoload)ed.]

Kent Cooper, AIA
Message 8 of 10

Here is the Button for AEWIRENO:

NicholasJCAD_0-1662483945428.png

After executing the Command:

NicholasJCAD_1-1662484033773.png

Here is the Button for AECOPYWIRENO:

NicholasJCAD_2-1662484122737.png

After executing the Command:

NicholasJCAD_3-1662484173369.png

After selecting the (?) Button from the Command Line with WD_COPY_WN:

NicholasJCAD_4-1662484324781.png

 

Note that the only Custom Commands my Company uses were created by me.

 

Message 9 of 10

That doesn't really answer the last two paragraphs in Message 7.  Though these are not created by you, that doesn't mean they aren't "custom" commands from AutoCAD's point of view, created by Acad Electrical for you.  The syntax in your WC_WIRE example in Message 1 suggests that's what they are, although I thought such things were not supposed to work with supplied arguments like your point-coordinate lists.  But it could be that the one you can't get to work that way is the kind that requires the dialog box, and doesn't have a command-line version.

Kent Cooper, AIA
Message 10 of 10

NicholasJCAD_0-1662554276700.png

This Command is entered differently through Lisp Format.

 

For Example:

(c:WD_WIRE '(1.0 1.0 0.0) '(2.0 1.0 0.0) "")
This draws a Wire using two Coordinates.
NicholasJCAD_1-1662554588481.png

None of the Commands I have mentioned have an Icon next to them when typed in the Command Line.

 

 

Hopefully this answered any Questions.

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

Post to forums  

Autodesk Design & Make Report

”Boost