AutoCAD Electrical c: commands from Lisp

AutoCAD Electrical c: commands from Lisp

mcoH3VZV
Advocate Advocate
4,193 Views
6 Replies
Message 1 of 7

AutoCAD Electrical c: commands from Lisp

mcoH3VZV
Advocate
Advocate

I am working on editing wdio.lsp, the PLC IO Import Utility lisp function.

 

Within it, I am using functions such as insert, explode, and c:wd_wire to draw wires.

 

I now want to use more functions, like c:AESOURCE, c:AELINK, and c:AEEDITCOMPONENT. 

 

The problem is, I am not sure of the syntax for these functions. In the lisp, if I type in (c:AELINK), then the system stops and prompts me to select the first device to link. However, (c:AELINK "0,0" "1,1" "") and (c:AELINK "0,0" "1,1") both do not work and I simply get a "too many arguments" error for both. I have a component at both of these locations, and typing in those arguments from the command line works perfectly.

 

Why won't this work in lisp? Any thoughts?

 

Thanks

0 Likes
Accepted solutions (1)
4,194 Views
6 Replies
Replies (6)
Message 2 of 7

rhesusminus
Mentor
Mentor
Accepted solution

Those commands are not exposed through the API of AutoCAD Electrical.
when you defun c:commandname in lisp, it means that the command is available at the command line. Commands for the command line are often supposed to be interactive, and not used in code.

 

You can find the available lisp commands in the API help:

2019-01-29_15-50-34.png

 

All that being said.. Not nearly enough of the API is exposed to users, so for many things, like the AELINK, you'll have to create your own functions to draw it.

There, you'll have to find the coordinates for the the link (the X?LINK attributes), and create a polyline between those points. Then, make sure the polyline is on the LINK-layer. Then you can either save the file and run the AEREBUILDDB, to recreate the database, or... You can manually add the necessary info to the COMPLINK table in the scratch database.


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Autodesk Expert Elite Alumni
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 3 of 7

rhesusminus
Mentor
Mentor
And.. You'll also need to do something with the child components you're linking to, like hiding some attributes etc.

Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Autodesk Expert Elite Alumni
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
0 Likes
Message 4 of 7

mcoH3VZV
Advocate
Advocate

Thanks for the help.

 

Is there a command that will hide an attribute on that API help somewhere? I have been able to draw the line and connect everything, but cannot find anything to hide an attribute.

 

0 Likes
Message 5 of 7

rhesusminus
Mentor
Mentor
That's standard functionality in the AutoCAD API.
The Attribute References should have a "visible-property".
I don't know how to set this property in Lisp, only in .NET or VBA.

Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Autodesk Expert Elite Alumni
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
0 Likes
Message 6 of 7

p.kumar69BUQ
Observer
Observer

HI even i am trying to developing the automation tool. could you please suggest me 

0 Likes
Message 7 of 7

rhesusminus
Mentor
Mentor

I can.

 

Learn AutoCAD. Learn AutoCAD Electrical. Learn Autolisp.

 


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Autodesk Expert Elite Alumni
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉