Link Layout name to file name

Link Layout name to file name

Anonymous
Not applicable
10,128 Views
20 Replies
Message 1 of 21

Link Layout name to file name

Anonymous
Not applicable
Hello
Is there a way to link a layout name to the file name (so that if changes if I change the dwg name)? I am not able to make it a field and don't really know if it's possible.
Thanks
Accepted solutions (1)
10,129 Views
20 Replies
Replies (20)
Message 2 of 21

ChicagoLooper
Mentor
Mentor

If you want the field that corresponds to the AutoCAD file such as, MyFavDrawing.dwg  then you can use the field dwgname. You can insert the field into mtext or as an attribute in a block, simply RIGHT CLICK at the position of mtext where you want the field (or in the block editor where you'd normally type in a block attribute) select 'Insert Field....' from the shortcut menu. You can grab the field here:

Right click>Other>SystemVariable>dwgname.Right click>Other>SystemVariable>dwgname.

 

Alternatively, click the application icon (big red A in upper left) then Drawing Utilities=>Drawing Properties=>Summary tab=>Title area>>>>>Type in your TITLE.Application>Drawing Utilities>Drawing Properties>Then Type your title here.Application>Drawing Utilities>Drawing Properties>Then Type your title here.

 

Click application icon (big red A in upper left) select Drawing Utilities=>Drawing properties=>Summary Tab=>Title

Type in any title (doesn't necessarily have to same as dwg name.)Type in any title (doesn't necessarily have to same as dwg name.)                  

 

To grab the title you just entered, treat it as a field by going here:

Right click>Insert Field and go here to get the itle.Right click>Insert Field and go here to get the itle.

 

As a bonus, when you right click the dwg file in a windows  folder (you don't have to open it, just right click it) select properties and you'll see your title on the summary tab.

 

Chicagolooper

EESignature

0 Likes
Message 3 of 21

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

This can be done in Sheetsets with the rename and renumber feature.  If the drawing is not part of a sheetset then perhaps some searching through the Autodesk App Store might be fruitful There are many layout related tools.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 4 of 21

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

I am checking back to see if my post helped you with your problem or question. Please mark my post as the solution if it resolved the issue or give me a bit more detail on this issue so we can continue to work towards getting this solved.

 

 

 

Please hit the Accept as Solution button if a post or posts solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 5 of 21

Anonymous
Not applicable

Hello and thank you for your answer.

 

I managed to insert the field as a text somewhere in the drawing, but not as the Layout name. 

 

Any ideas on how to do that?

0 Likes
Message 6 of 21

john.vellek
Alumni
Alumni

Hi @movieboxdv005,

 

That is actually pretty easy to do.

 

I made a video to show the steps:

  • Inert Field
  • Link it to Other/System Variables/Ctab

From there you can decide how the field should be formatted.

 

Please select the Accept as Solution button if my post solves your issue or answers your question.

 

 


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 7 of 21

Anonymous
Not applicable

Thank you for your answer again.

 

I feel I didn't explain myself properly then.

 

In your video, you insert a field with the ctab name somewhere in the drawing. I'm trying to do the opposite: make the layout name change according to the filename. I thought that could be easily solved if inserting a field with the file name as the Layout name, but that doesn't seem to be possible.

 

I have a Lisp that does it, but would need something automatic as it'll be used in LT.

 

Thanks

Message 8 of 21

ChicagoLooper
Mentor
Mentor

Making the layout name match the filename wouldn't be useful nor practical. For example, if you have a single drawing with a filename MovieBox Skyscraper you may have four layout tabs, with each tab depicting a different view of the building, i.e. north view, south, east and west. As you can see, taking the filename MovieBox Skyscraper and applying it to each and every layout tab would be confusing

Chicagolooper

EESignature

0 Likes
Message 9 of 21

Anonymous
Not applicable

Well, it's not up to me wether it makes sense or not. The thing is that we work with several drawings, each of them having one model and one and only one Layout. Actually, the purpose of this cames when generating the a pdf containing all the drawings, as we want (we are told to have) the bookmarks to be the filename of each drawing (which is an internal code we use). {And no, we can't all the drawings together in the same file, or any other solutions. We don't have that power haha}

 

As it doesn't seem possible to print without the Layout name (but you can print without the filename), a solution we thought was naming automatically the layout as the filename. Of course we could do this manually (which is not desirable, as we are talking about hundreds of drawings) or with a Lisp, but that's what we are trying to avoid. (I.E. if we insert a drawing, codes may change and we can easily rename the files with some random batch file renamer. But we would need the layout name to get uploaded too).

Message 10 of 21

Anonymous
Not applicable

Did you ever find a solution to this? I am in the same situation.

Message 11 of 21

Anonymous
Not applicable
Accepted solution

Something like ?

(command "_.LAYOUT" "_Rename" (getvar "ctab") (getvar "dwgname"))

ctab.gif

Message 12 of 21

maratovich
Advisor
Advisor

Specify what you need. What is the purpose?
Attach your example file - whatever you want.

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 13 of 21

Anonymous
Not applicable

@Anonymous wrote:

Something like ?

(command "_.LAYOUT" "_Rename" (getvar "ctab") (getvar "dwgname"))

ctab.gif


Thanks for the reply. This is close, I was hoping for something that changes when the file name changes. Also is there a way to remove the file extension?

0 Likes
Message 14 of 21

Anonymous
Not applicable

@Anonymous wrote:


Thanks for the reply. This is close, I was hoping for something that changes when the file name changes. Also is there a way to remove the file extension?

I do not know a way to make it possible.


Here is the code without the ".DWG "

(defun c:Test nil
  (command "_.LAYOUT" "_Rename" (getvar "ctab") (substr (getvar "dwgname") 1 (-(strlen (getvar "dwgname")) 4)))
  (princ)
  )
Message 15 of 21

masadSDNRX
Explorer
Explorer

Thanks a lot Mr. Chris

0 Likes
Message 16 of 21

darin_alexander
Observer
Observer

I see this thread is a few years old but the only result even close to my search...


New to AutoCAD and just started the 1st learning course. It looks like the files and "Step-by-step" visuals are from earlier versions?!   

 

Is there a way to get the Drawing Tab to be the same as in the training videos and screen shots?  All I am getting are sequential numbers each time a new tab is opened, even with drag and drop of the "acad.dwt" file provided in the download.

darin_alexander_2-1679825567764.png

darin_alexander_3-1679825595406.png

darin_alexander_4-1679825612786.png

 

File Tab only shows "Drawing#" :

darin_alexander_5-1679825673423.png

 

 

0 Likes
Message 17 of 21

cadffm
Consultant
Consultant

Hi ,

 

1. Open a .DWT file is for editing a template.

   Your picture shows the acad.dwt, this is a standard Autocad template what should never edited!

    Instead for editing standard defaults, create your own one.

 

>>"it looks like the files and "Step-by-step" visuals are from earlier versions?!   "

Yes, the shape is different know.

 

 

>>"Is there a way to get the Drawing Tab to be the same as in the training videos and screen shots? "

The shape changed, you can not change it.

 

>>"All I am getting are sequential numbers each time a new tab is opened, "

Thats perfect!

You starting a new file (instead of your picture with an open .dwt file, ehich is for editing the template)

Drawing# is a temporary name for your new file, use SaveAs to save this new file fir the first time.

-

If you really want to EDIT a template(but please, not a standard  pre set template), you have to go this way:

Command OPEN, change the file extension to .DWT, choose your .dwt you want to open.

 

How to save a new  .dwt:

SaveAs, change FileExtension to .DWT

save your template . 

 

Sebastian

0 Likes
Message 18 of 21

cadffm
Consultant
Consultant

Please share the Link to this video/course 

because the part with the "1." In front of is bad/wrong.

 Text is right and okay, but the picture with [acad.dwt] doesn't match the situation.

 

This is why you stumbled.

Drawing# is correct 👍

 

Sebastian

0 Likes
Message 19 of 21

darin_alexander
Observer
Observer

Thank you for the explanation! 

LINK:  Technical Drawing for Design and Drafting - Introduction to template creation | Autodesk

In the lesson an instructor shows how to use this file to create a clean new template file. 
As mentioned originally, both Video and Screen shot Instructions show the "acad.dwt" tab but I could not get the tab name to match by following the instructions of "open a new" or "use the provided template file" with drag and drop.  Use of "Open File" and browsing to the provided template "acad.dwt" was the only way I found to have the tab finally show the name as the lesson portrays. 
Many steps are just the sound of clicks and not explained or shown clearly, making it difficult to realize the same results, rather important aspects for any beginning course. 

darin_alexander_0-1679828459188.png

 

0 Likes
Message 20 of 21

darin_alexander
Observer
Observer

Btw... The next lesson continues with editing the "acad.dwt" file:

Technical Drawing for Design and Drafting - Create the AutoCAD template | Autodesk

darin_alexander_0-1679830290588.png

 

0 Likes