Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
sethtriad
Posts: 27
Registered: ‎09-27-2011
Message 1 of 5 (636 Views)

AutoCAD Electrical 2011 Lisp script for inserting ladders

636 Views, 4 Replies
02-14-2013 06:41 PM

Is it possible within ACADE 2011 to use a lisp command to create a ladder with a set spacing, ladder # scheme, and rung spacing?

 

Typing AELADDER into the command line brings up the dialogue box where you can fill out the above information, but typing (command "AELADDER") returns an error. I'm not sure if that error is because it doesn't recognize it, or if it's becuase I don't have any variables after "AELADDER".

*Expert Elite*
Kent1Cooper
Posts: 5,540
Registered: ‎09-13-2004
Message 2 of 5 (623 Views)

Re: AutoCAD Electrical 2011 Lisp script for inserting ladders

02-14-2013 07:46 PM in reply to: sethtriad

sethtriad wrote:

Is it possible within ACADE 2011 to use a lisp command to create a ladder with a set spacing, ladder # scheme, and rung spacing?

 

Typing AELADDER into the command line brings up the dialogue box where you can fill out the above information, but typing (command "AELADDER") returns an error. I'm not sure if that error is because it doesn't recognize it, or if it's becuase I don't have any variables after "AELADDER".


I don't have Electrical, but the (command) function recognizes only the names of native AutoCAD commands, not those that are specialty functions in overlays, or user-defined commands.  In case that's defined similarly to a user-defined (defun C:WHATEVER () ....  command, try invoking it this way:

 

(C:AELADDER)

 

By the way, if what you mean by "ladder" is what I've usually heard called a "cable tray," take a look at this thread .  It doesn't work from a dialog box, and I guess it's not likely to be better than AELADDER, but you never know -- for example, it remembers all your option choices and offers them as defaults on subsequent uses, which many AutoCAD commands don't do [I couldn't say about AELADDER].

Kent Cooper
Active Contributor
sethtriad
Posts: 27
Registered: ‎09-27-2011
Message 3 of 5 (603 Views)

Re: AutoCAD Electrical 2011 Lisp script for inserting ladders

02-15-2013 06:06 AM in reply to: Kent1Cooper

Typing (C: AELADDER) brings up the dialogue box for the ladder command, which is a start!

 

A ladder is for schematic diagrams of electrical connections between power sources and different devices. For DC power, imagine a ladder with two vertical supports and 10 horizontal rungs, the support on the left represents V+, and the support on the right represents GND. For AC, there are three supports, one for V+, one for Neutral, and the third for GND.

 

When running the ladder command, a dialogue box opens where I need to specify if the ladder is 2 or 3 phase (dc or ac), the spacing of the "supports", the distance between rungs, and the numbering of the rungs. 

*Expert Elite*
Kent1Cooper
Posts: 5,540
Registered: ‎09-13-2004
Message 4 of 5 (599 Views)

Re: AutoCAD Electrical 2011 Lisp script for inserting ladders

02-15-2013 06:26 AM in reply to: sethtriad

sethtriad wrote:

Typing (C: AELADDER) brings up the dialogue box for the ladder command, which is a start!

 

A ladder is for schematic diagrams of electrical connections between power sources and different devices. For DC power, imagine a ladder with two vertical supports and 10 horizontal rungs, the support on the left represents V+, and the support on the right represents GND. For AC, there are three supports, one for V+, one for Neutral, and the third for GND.

 

When running the ladder command, a dialogue box opens where I need to specify if the ladder is 2 or 3 phase (dc or ac), the spacing of the "supports", the distance between rungs, and the numbering of the rungs. 


Well, that reminds me of something from a while back....  You might be interested in at least looking into Ladder.lsp with its Ladder command, on this thread.  [The one in Message 11 works only in 2D; the one in Message 14 works in 2D or in 3D, which I can't imagine you would need.]  But they're not dialog-box-based, so AELADDER is likely easier to use.  However, if you've got some of those answers already determined in variables or something, and you can't find a way to feed them into AELADDER in Lisp, either of those could easily be edited to take those answers and incorporate them.  And either could be edited to draw 3 "rail" lines instead of 2, or to have the option.

Kent Cooper
Active Contributor
sethtriad
Posts: 27
Registered: ‎09-27-2011
Message 5 of 5 (592 Views)

Re: AutoCAD Electrical 2011 Lisp script for inserting ladders

02-15-2013 06:46 AM in reply to: Kent1Cooper

Interesting stuff; however, we can't use lines because things would get messy. 

 

Using the ladder command, Autocad knows where devices are and can automatically reference things to each other, when applicable. For instance, if there is a relay contact on page 1 that is controlled by the relay coil on page 100, autocad will automatically add a reference number to each component telling the electrician where the other part is located in the package. If the ladder command wasn't used, we'd have to go through every drawing and find the corresponding component. Using the ladder command makes things run much smoother. 

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.