Results 1 to 4 of 4

Thread: Rename Layout tabs on multiple .dwg

  1. #1
    I could stop if I wanted to
    Join Date
    2004-10
    Location
    Orange County
    Posts
    211
    Login to Give a bone
    0

    Default Rename Layout tabs on multiple .dwg

    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?

  2. #2
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Rename Layout tabs on multiple .dwg

    Quote Originally Posted by Dave Lewis View Post
    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?
    You cannot have more than one layout with the same name, I am not familiar with a way to globally change the name, I suppose someone could write a lisp routine that would switch from layout to layout and automatically rename the layout.

  3. #3
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Rename Layout tabs on multiple .dwg

    Quote Originally Posted by Dave Lewis View Post
    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...
    Code:
    
    (renlay "PLOT")
    
    ...to have all the layouts renamed to PLOT1, PLOT2, PLOT3, etc.

    Call it like this...
    Code:
    
    (renlay "Layout")
    
    ...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.
    R.K. McSwain | CAD Panacea |

  4. #4
    Certifiable AUGI Addict dzatto's Avatar
    Join Date
    2006-12
    Location
    Big "D"
    Posts
    3,711
    Login to Give a bone
    0

    Default Re: Rename Layout tabs on multiple .dwg

    Man I wish I knew how to write code like that.

Similar Threads

  1. Rename Layout Tabs
    By paulof in forum AutoLISP
    Replies: 7
    Last Post: 2017-05-26, 06:18 PM
  2. Batch Rename Tool for Layout Tabs?
    By WhataMaroon in forum AutoCAD Customization
    Replies: 3
    Last Post: 2016-11-06, 03:01 AM
  3. View multiple layout tabs
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2015-10-08, 03:58 PM
  4. Plot Multiple Layout tabs
    By roy.70844 in forum AutoCAD General
    Replies: 4
    Last Post: 2004-10-07, 03:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •