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

LISP to replace AELADDER command in Electrical

1 REPLY 1
Reply
Message 1 of 2
TomTom111
434 Views, 1 Reply

LISP to replace AELADDER command in Electrical

I came up with a way to replace the AELADDER command in AutoCAD Electrical, and completely automate the ladder insertion portion of our schematics, as they have the same spots virtually every time.

 

I ran into a problem where my second ladder is giving me issues with the AutoCAD Electrical functionality.

 

So my question is this, has anyone come up with a way to automate the AELADDER command for AutoCAD Electrical?

Or so i may be able to get it working again on my own, can someone help with a way to select one of two blocks on a drawing that have exactly the same name, but are across the drawing from each other?

 

--Thanks in advanced.

1 REPLY 1
Message 2 of 2
gcsjlewis
in reply to: TomTom111

I have found a good way if you know how to use the "BlackBoard"  Here's a little bit of code that will show you what i did:

 

(setq page_counter 1)  ;;sets first number @1

(vl-bb-set 'page_counter page_counter)  ;;stores it globally

 

;api command

 

 

(c:wd_in_ladder 1 (list 1.0 21.5 0.0) nil 20.5 "H" 10.0 0.5 nil 1 nil -1 (itoa (vl-bb-ref 'page_counter)) 2);;;you may need to look up this api command in the help section for the different options this is just what i use

 

 

Then after that, at the end of your lisp you need to have the following line:

 

(setq page_counter (+  XX page_counter));; where XX is how many rung numbers you want to use

;;Then

 

(vl-bb-set 'page_counter page_counter);; this stores the next starting number for the next page

 

 

If you need a little more guidance let me know

 

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost