- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I use Autocad LT every day for work and have created a template with a number of layouts with a standard title.
I would like to create a script that can rename the title of the layout tab so that I don't have to do this manually.
I have already had a script created by 'ChatGPT', but this does not work.
can anyone help me to create a script to rename the layout tabs?
this was the script:
(defun c:RenameLayouts ()
(vl-load-com) ; Load the Visual LISP functions
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) ; Get the active document
(setq layouts (vla-get-Layouts doc)) ; Get the layout collection
(vlax-for layout layouts
(setq layoutName (vla-get-Name layout))
(cond
((= layoutName "L_V_XXXX")
(vla-put-Name layout "L_V_1111")) ; Rename 'L_V_XXXX' to 'L_V_1111'
((= layoutName "L_B_XXXX")
(vla-put-Name layout "L_B_1111")) ; Rename 'L_B_XXXX' to 'L_B_1111'
)
)
(princ) ; End function
)
thank you
Solved! Go to Solution.