TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Krushert on October 11, 2007, 01:45:06 PM

Title: How to change the Name of the Layout Tab ????
Post 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.
Title: Re: How to change the Name of the Layout Tab ????
Post by: Jeff_M on October 11, 2007, 01:56:03 PM
Try here:

http://www.theswamp.org/index.php?topic=1466.0
Title: Re: How to change the Name of the Layout Tab ????
Post by: Krushert on October 11, 2007, 04:04:20 PM
Try here:
Thank you I will try to look at tomorrow.  Have to go home to a sick child.
Title: Re: How to change the Name of the Layout Tab ????
Post by: KewlToyZ on October 11, 2007, 04:10:07 PM
Something like:

Code: [Select]
(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)
)
Title: Re: How to change the Name of the Layout Tab ????
Post by: Krushert on October 12, 2007, 07:47:49 AM
Something like:

Quote
(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
Title: Re: How to change the Name of the Layout Tab ????
Post by: KewlToyZ on October 12, 2007, 12:01:42 PM
Usually lisp will run through without the dialog box, but in case it pops up try "-layout" just in case.
Title: Re: How to change the Name of the Layout Tab ????
Post by: DEVITG on October 14, 2007, 09:57:45 AM
A VL way

Code: [Select]
(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)
Title: Re: How to change the Name of the Layout Tab ????
Post by: KewlToyZ on December 06, 2007, 08:44:35 PM
Nice! Gonna have to ask if I can steal that bit of poetry :P
Title: Re: How to change the Name of the Layout Tab ????
Post by: DEVITG on December 06, 2007, 09:27:40 PM
Beware nobody see you.

Title: Re: How to change the Name of the Layout Tab ????
Post by: KewlToyZ on December 06, 2007, 09:36:03 PM
My posture leads me to beleive I am invisible  :ugly: