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

rename layout tabs

27 REPLIES 27
Reply
Message 1 of 28
GavrielKing
2170 Views, 27 Replies

rename layout tabs

Does anyone know if it is possible to write a lisp or script that will open an entire directory of drawings and automatically rename all of the layout tabs (even if there are multiple layout tabs in a certain drawing file) to include a period "." at the end of the tab name? I need this work in AutoCAD 2009 and 2010. Any advice is greatly appreciated. Tank you.
27 REPLIES 27
Message 21 of 28
GavrielKing
in reply to: GavrielKing

You are correct. However, I cannot figure out how to get the "renamelayout" lisp routine to run correctly on the drawings using ScriptPro. Thanks for the help though.
Message 22 of 28
Anonymous
in reply to: GavrielKing

Make sure the renamelayout.lsp loads by putting
(load "renamelayout.lsp") in your acaddoc.lsp file.
Some versions of autocad you needed to add a save and close command for it
to work. You'll have to test without it first.
(command "_.save" "" "_.close" "Y")
Think you just need to save a text file with a .scr extension and put the
following in it and use that script in scriptpro.

renamelayout
Message 23 of 28
GavrielKing
in reply to: GavrielKing

Thanks, but it's still not working. Attached is a screen shot of what I end up with.
Message 24 of 28
Anonymous
in reply to: GavrielKing

Zip and post all the files you are using as of now (.scr, .lsp...).
You have something wrong somewhere.
Message 25 of 28
GavrielKing
in reply to: GavrielKing

Ok, now I have it to the point that every time I open a drawing (or even just AutoCAD itself), it does rename the layout tab, but it closes the drawing immediately. So, I can't just open a drawing to work on it. How do I get this to only run when I want it to?
Message 26 of 28
GavrielKing
in reply to: GavrielKing

Ok, I got it working by taking (LOAD "RENAMELAYOUT") out of my acaddoc.lsp file and using this in the scr file:

(setq laylist (layoutlist))
(foreach x laylist
(command "layout" "R" x (strcat x ".")))

I still wish there was a way to do this without using ScriptPro, because it causes another session of AutoCAD to be opened up. My "PURGED" lisp routine uses the current session of AutoCAD and opens and purges an entire directory of drawings. I still think there is a way to incorporate the "renamelayout" lisp routine, into the "purged" routine, so all I have to do is issue the command and it will open each drawing in any given directory and purge and rename the tabs. I just don't have the knoweledge to accomplish it.

But, thank you very much for your help, I couldn't have gotten this far without it.

Happy Holidays!!!
Message 27 of 28
Anonymous
in reply to: GavrielKing

I did try to incorporate it into the purged lisp but couldn't get it to
work. I always used scriptpro if I had to change a mass of dwgs.
Glad to see you have something usable out of all this.

Merry Christmas
Jason
Message 28 of 28
GavrielKing
in reply to: GavrielKing

Yep. Thanks again for your efforts!

Merry CHRISTmas!!!

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

Post to forums  

Autodesk Design & Make Report

”Boost