Author Topic: How to change the Name of the Layout Tab ????  (Read 2819 times)

0 Members and 1 Guest are viewing this topic.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
How to change the Name of the Layout Tab ????
« 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.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: How to change the Name of the Layout Tab ????
« Reply #2 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.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

KewlToyZ

  • Guest
Re: How to change the Name of the Layout Tab ????
« Reply #3 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)
)

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: How to change the Name of the Layout Tab ????
« Reply #4 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
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

KewlToyZ

  • Guest
Re: How to change the Name of the Layout Tab ????
« Reply #5 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.

DEVITG

  • Bull Frog
  • Posts: 481
Re: How to change the Name of the Layout Tab ????
« Reply #6 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)
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

KewlToyZ

  • Guest
Re: How to change the Name of the Layout Tab ????
« Reply #7 on: December 06, 2007, 08:44:35 PM »
Nice! Gonna have to ask if I can steal that bit of poetry :P

DEVITG

  • Bull Frog
  • Posts: 481
Re: How to change the Name of the Layout Tab ????
« Reply #8 on: December 06, 2007, 09:27:40 PM »
Beware nobody see you.

Location @ Córdoba Argentina Using ACAD 2019  at Window 10

KewlToyZ

  • Guest
Re: How to change the Name of the Layout Tab ????
« Reply #9 on: December 06, 2007, 09:36:03 PM »
My posture leads me to beleive I am invisible  :ugly: