Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Quick way to rename layout tabs?

24 REPLIES 24
SOLVED
Reply
Message 1 of 25
KristinLindberg
45068 Views, 24 Replies

Quick way to rename layout tabs?

So, I have this drawing with over 200 layout tabs. (I do shop drawings for a cabinet/countertop manufacturer, and we do one drawing per project.) Here's the thing... I need to eliminate pages 1, 6, 14, 20, 24, 30, 40, 44, 47, 56, 61, 64, 73, 78, 81, 90, 95, and 101 because they are now NOT a part of the project.

 

Here's why that is a problem:

 

In my title block, I  have the layout name as a field, so it says "PG [layout tab name]/224" which is needed because there's a table of contents for the pages that are printed.

 

Is there any easy eay to renumber all the tabs, or am I stuck re-numbering every single one?

AutoCAD Mechanical 2013 SP2
AutoCAD 2013 SP2
24 REPLIES 24
Message 2 of 25
pendean
in reply to: KristinLindberg

There is no automatic way in LT.

Message 3 of 25

Will this work...Rename the unneeded tabs to Not Used-1, Not Used-6, etc, delete the viewports from those layouts,and now your Title Block shows the Table of Contents with layouts as Not Used-1, etc?

 

Just an idea.

m

Message 4 of 25

Unfortunately I think that would confuse the workers down in the shop even more.

AutoCAD Mechanical 2013 SP2
AutoCAD 2013 SP2
Message 5 of 25
KristinLindberg
in reply to: pendean

Is there an automatic way with AutoCAD (full version)? I have AutoCAD at home (not student version - we had the scary plot stamp stuck in our office for awhile from a temp worker on a laptop - YIKES). Maybe I could open it into AutoCAD and save and then open it back up in LT. Any suggestions there?

AutoCAD Mechanical 2013 SP2
AutoCAD 2013 SP2
Message 6 of 25
pendean
in reply to: KristinLindberg

If you have access to AutOCAD, you can post in the Customization Discussion area for an automation customization:
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/bd-p/130

Your original post, repeated there, would be plenty of info to share (with the screenshot).

Message 7 of 25
steven-g
in reply to: KristinLindberg

The layout command will allow you to rename a tab layout, so a simple script would do the job, in windows notepad create a simple command matrix as follows

 

layout r 1 1

layout r 2 2

layout r 3 scratch

layout r 4 3

layout r 5 4

layout r 6 scratch1

layout r 7 5

layout r 8 6

layout r 9 scratch2

layout r 10 7

 

this gives you a logical view of which layouts need to alter ,the first 2 layouts in the example are fine (the "r" is for rename)

then split this matrix up into individual lines as shown below, make sure there are no spaces anywhere even at the end of a line (the very last line should be a blank line).

 

script-----

layout

r

3

scratch

layout

r

4

3

layout

r

5

4

layout

r

6

scratch1

layout

r

7

5

layout

r

8

6

layout

r

9

scratch2

layout

r

10

7

 

script-----

 

Save the file with an extension scr ("Rename.scr"). Look in the help files for how to run a script in autocad, but you can just drag it onto the autocad window from windows explorer. In the example I started with tabs 1-10 and finished with 1-7 plus 3 tabs called scratch* then just delete the scratch files. Create a test drawing with 10 tabs to try it and whenever you run a script like this I would advise doing it on a copy of a file just in case of errors.

 

Message 8 of 25
pendean
in reply to: steven-g

I'm all for autoamtion when it saves time, but for a one-off and at over 99 layouts to delete and rename, it would probably be quicker to manually do so that wrting a script out in full like that IMHO.

 

Right-click a layout, delete.

Double-click a layout, type in new name.

 

So much quicker for a one-off 99 layout renaming and deletion project.

 

Either way, if you are going to suggest a fix, go all the way and not partial to only suit your needs. The OP wishes to delete as well as rename, so the script would be more accurately represented like this:

 

layout

delete

1

layout

rename

2

1

layout

rename

3

2

layout

rename

4

3

layout

rename

5

4

layout

delete

6

layout

rename

7

5

 

and so on all the way to layout number 99.

Message 9 of 25
KristinLindberg
in reply to: pendean

Can't believe I forgot about the layout command... what was I (not) thinking?!

AutoCAD Mechanical 2013 SP2
AutoCAD 2013 SP2
Message 10 of 25
steven-g
in reply to: pendean

Either way, if you are going to suggest a fix, go all the way and not partial to only suit your needs. and what would my needs be.Cat Very Happy

 

I was under the impression the discussion groups were to encourage discussion and give people assistance in finding solutions. It's very easy to say it can't be done and then later come back and say I can do it better when someone else offers a suggestion. I will humbly admit to an oversight on my part for completely missing the delete option, but I was concentrating on the rename part of the question. And indeed I could have gone the whole way and written the whole script and posted it here, but my intention was to show a method that exists and works. And as a matter of fact and not opinion It actually took me just under 2 minutes to complete the script for 201 tabs, I use excel to automate scripts regularly, If it was something that the OP does regularly, and has excel, that could be reduce down to one excel cell to hold the number of tabs in a drawing then a list of the tab numbers to be removed. (rough guess for the example given 20 seconds)

Message 11 of 25
pendean
in reply to: steven-g

There is a fair amount of "arm waiving" advise being dished out around here, and while some new members may be able to figure it out eventually on their own, we 'regular' contributors should do less of that and be more deliberate and focused with out contributions. No one's perfect, I do the shortcut answer too sometimes, but you got to try and assume anyone seeking help is not sure how to proceed.

 

>>>... It actually took me just under 2 minutes to complete the script for 201 tabs, I use excel to automate scripts regularly,...<<<

More arm-waving answers do no one any good.

Message 12 of 25
steven-g
in reply to: pendean

OK I understand what you mean, but how far should you take it, as I suggested I tend to look at this as offering people a direction to look into, there are too many people on forums saying 'do this for me' who are incapable of doing anything without full blown tuorials on how to draw a yellow line, and tommorrow they come back and ask what if I need it to be red. The OP in this case picked up on the layout command and will use it as they see fit, with or without the script. Which I would say is a good result. And what you call 'arm waiving' I prefer to think of as dropping subtle hints to people who are genuinely looking to learn, ---Here is more arm waiving--- Smiley Very Happy I could have posted a fully working excel spread sheet that would allow the OP to automate the process as I indicated, but that is how I would do the same job myself and is probably something the OP wouldn't even look at. And if anyone picks up on it and wishes the discussion to go in that direction then so be it.

Message 13 of 25
korey.childs
in reply to: steven-g

This was awesome! Saved me a lot of time. Instead of re-naming the tabs I didn't need then deleting them, I just directly deleted them.

 

layout
r
11
13
layout
d
A1
layout
r
10
12

 

Thank you for your help though!

DeWayne
CADD enthusiast since 1984
Message 14 of 25
arkelec
in reply to: steven-g

Great advice, going to save me a lot of time in the future.

 

One thing to note, my tab names have spaces in them:

 

e.g. Layer-E1 Rev-T1

 

 

By using the syntax:

 

layer

rename

"Layer-E1 Rev-T1"

Layer-E1-Rev-T1

 

 

the " " fixes the issue with spaces in the script.

Message 15 of 25
conradjot
in reply to: steven-g

I also used CONCAT command in Excel which helped me to write a script.
https://support.office.com/en-us/article/concat-function-9b1a9a3f-94ff-41af-9736-694cbd6b4ca2


(...)

It actually took me just under 2 minutes to complete the script for 201 tabs, I use excel to automate scripts regularly, If it was something that the OP does regularly, and has excel, that could be reduce down to one excel cell to hold the number of tabs in a drawing then a list of the tab numbers to be removed. (rough guess for the example given 20 seconds)


 

Message 16 of 25
jonathan.kwa
in reply to: steven-g

Thank you for this, very useful to know and worth the effort in my opinion.

 

In my case I didn't need to remove spaces or enter the commands on seperate lines.  I just generated my layout numbers in Excel, saved as .txt file, renamed to .scr and then it was ready to use.

 

I replying to an old post, so technology may have moved on!

Message 17 of 25
steven-g
in reply to: jonathan.kwa


@jonathan.kwa wrote:

Thank you for this, very useful to know and worth the effort in my opinion.

...

I replying to an old post, so technology may have moved on!


Not a lot has changed script's and macro's still work the same way generally.

Message 18 of 25

@steven-g @pendean This is 8 years after the two of you offered solutions to an issue that I'm having very similar problems to.  I have about 40 layout tabs to delete and 40 other tabs to delete. There area bout 45 layouts that will neither be deleted or renamed.  I saw you were referring to writing a script in notepad or excel and use it to delete or rename tabs; I'm not familiar with this process at all if you could please shed some light on how to execute the script.

 

Thank you for the info you've already supplied in the first forum

Message 19 of 25

>>>...I have about 40 layout tabs to delete and 40 other tabs to delete. There area bout 45 layouts that will neither be deleted or renamed...<<<
40 + 40 = 80, _ 45?
Same DWG file, or different DWG files?
One layout per file, or dozens per file?

Are you actually using the LT version of AutoCAD (topic of this forum)?

IMHO by the time you finish typing the name of each layout to run in a script, then test the script, you would have manually deleted all the layout tabs manually by simply selecting the deleting them.

Elaborate please.
Message 20 of 25

Several good questions, and the most pertinent one is that I navigated here from google and didn't realize it was an Autocad LT board. I'm on Civ3d, but it may be possible that the command works across both platforms.  This is one drawing that contains roughly 125 tabs of which 40 need to be deleted and 40 need to be renamed.

 

And I know that it may not be the most effective use of time in this instance I absolutely think it will be beneficial in future instances.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost