Originally Posted by
Dave Lewis
I have a project where the layout tabs are all out of wack
Is there any way to rename all the layout tab names in the project with something generic like PLOT or Layout1?
Here is a quick function to do that:
Code:
(vl-load-com)
(defun RenLay ( kword / n)
(setq n 1)
(vlax-for x (vla-get-Layouts (vla-get-ActiveDocument (vlax-get-acad-object)))
(if (not (eq (strcase (vla-get-name x)) "MODEL"))
(vla-put-Name x (strcat kword (itoa n)))
)
(setq n (1+ n))
)
)
Call it like this...
...to have all the layouts renamed to PLOT1, PLOT2, PLOT3, etc.
Call it like this...
...to have all the layouts renamed to Layout1, Layout2, Layout3, etc.
Note, I did not include error checking in case a layout name already exists.
If you use the word "Layout" and there is already a layout named "Layout1" - it will fail.