TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Krushert on October 11, 2007, 01:45:06 PM
-
I can find a bunch of post about reading the name of the CTAB variable, but I can not find one on how to change the name via code.
Can someone point me in the right direction?
Thanks.
-
Try here:
http://www.theswamp.org/index.php?topic=1466.0
-
Try here:
Thank you I will try to look at tomorrow. Have to go home to a sick child.
-
Something like:
(defun c:MyLayout()
(command "expert" "2")
(setq shtnm (getstring "\nEnter new paper space layout description: (Example: 30x42-YourTitle) :"))
(command "layout" "t" "MyTemplate.dwt")
(command "MyLayoutTabName")
(command "layout" "rename" "MyLayoutTabName" shtnm)
(command "layout" "s" shtnm)
(princ "\nLayout renamed.")
(princ)
)
-
Something like:
(defun c:MyLayout()
(command "expert" "2")
(setq shtnm (getstring "\nEnter new paper space layout description: (Example: 30x42-YourTitle) :"))
(command "layout" "t" "MyTemplate.dwt")
(command "MyLayoutTabName")
(command "layout" "rename" "MyLayoutTabName" shtnm)
(command "layout" "s" shtnm)
(princ "\nLayout renamed.")
(princ)
)
Thank you KewlToyZ.
I suspected there would be a way to command line it, but I could not find it.
I will post back what I out together
-
Usually lisp will run through without the dialog box, but in case it pops up try "-layout" just in case.
-
A VL way
(vl-load-com)
(setq adoc
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(setq layout-col (vla-get-layouts adoc));_all layouts
(vlax-for layuot layout-col
(print (vla-get-name layuot))
)
(setq old-layout-name "Layout2")
(setq new-layout-name "30x42-YourTitle")
(vla-put-name (vla-item layout-col old-layout-name ) new-layout-name)
-
Nice! Gonna have to ask if I can steal that bit of poetry :P
-
Beware nobody see you.
-
My posture leads me to beleive I am invisible :ugly: