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

LISCP or SCRIPT for renaming ladders in AutoCAD Electrical

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
crosby.109
831 Views, 6 Replies

LISCP or SCRIPT for renaming ladders in AutoCAD Electrical

I am looking for either a LISP routine or SCRIPT to eventually do all of the following:

 

1.)  Insert Drawings into a project from a server directory

 

2.)  Rename ladders on each drawing

 

3.)  Update Symbol Tags, WireNumbers, and Cross References

 

Any ideas from the experts out there?  I am new to LISP but have begun reading here: http://www.afralisp.net/visual-lisp/

 

Thanks!

6 REPLIES 6
Message 2 of 7
crosby.109
in reply to: crosby.109

I have already completed the LISP that finds the first components of the ladders and then updates the values accordingly in FIRSTRUNG but then when i try to call the object method Update() with:

 

(vla-update AXName) ; where AXName is the Active X object of the first element in ladder

 

But the ladders don't update the rest of the rungs . . .

 

Any ideas??

Message 3 of 7
crosby.109
in reply to: crosby.109

It looks as though the rest are just text and don't mean anything and there isn't a method to invoke, I just have to go in and change all the text . . . crikee

Message 4 of 7
hmsilva
in reply to: crosby.109

Hello crosby.109 and welcome to the Autodesk Community!

 

I'm not a AutoCAD Electrical guy, and I don't think there are many out here, let's wait and see.

In the meantime, let's see if I can give you some help...

 

For the: Insert Drawings into a project from a server directory

you can try

 

(c:ace_add_dwg_to_project "//servername/dir/dwgname.dwg" (list "" "" (list "" "FirstlineDrawing description" "SecondlineDrawing description") nil))

where the paramlst are:
(nth 0 ) = "Sec" section code.
(nth 1 ) = "Subsec" code.
(nth 2 ) = "Drawing description" or list of three descriptions.
(nth 3 ) = 1 to suppress project file freshen after drawing is added to project.

 

HTH
Henrique

EESignature

Message 5 of 7
crosby.109
in reply to: hmsilva

Thanks!

 

I will mark you as the answer if you know how to rename the drawing after adding it in. . . or where there is any directory on a list of commands such as c:ace_add_dwg_to_project.  I feel like there is a lack of literature and makes it unnecessarily difficult to learn

 

I already finished the changing rungs and text automatically per drawing and was planning on creating a .scr file that ran project wide which ran my LISP first, then RETAG Components, then Wire Numbers refresh . . .

Message 6 of 7
hmsilva
in reply to: crosby.109

You're welcome, crosby.109
as I said earlier, I'm not a AutoCAD Electrical guy, therefore I have no way of testing with AutoCAD_E...

 

But this might help you!

 

HTH
Henrique

EESignature

Message 7 of 7
gcsjlewis
in reply to: crosby.109

Here is what i use to do something very similar:

 

(setq project_wdp_location (ace_getactiveproject)); This will get the active drawing file location

(setq space_location (vl-string-position 32 (vl-filename-base project_wdp_location) 3)); this will grab only a part of the drawing name

You will have to customize this for yourself and your own standards

 

(setq new_file_titlepage (strcat (vl-filename-directory project_wdp_location) "\\" first_part "-01.dwg"));; This will create a new file in your "job folder"

 

(setq tite_page (vl-file-copy "Template extension goes here" new_file_titlepage));; This will copy your template into the drawing you created from the code above

 

(c:ace_add_dwg_to_project  new_file_titlepage  (list "" "" (list "TITLE PAGE" "DRAWING INDEX" "") nil)); this adds it to the active project and sets descriptions

 

 

Hope this helps

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

Post to forums  

Autodesk Design & Make Report

”Boost