« Room with a view... | Main | Good Question: Dynamic block tool tips »

Good Question: Layout names and fields

Today’s Good Question comes from Tannar. He asked if there is a way to extract the layout name from a drawing to use in a field. His company has drawings with multiple layout tabs, which they name by sheet number. Tannar would like to automate the process of numbering the sheets in the titleblock by reading them directly from the layout names.

I couldn’t think of a quick solution for Tannar, but it seemed like a great idea and one that might be easy with a little programming. I often receive questions like this, especially for sheet set functionality. Even if the core AutoCAD software doesn’t include the specific option you are looking for, most AutoCAD tools, including sheet sets, provide a programming interface that enables you (or a qualified consultant) to create the desired behavior. I, unfortunately, am not a qualified programming consultant (the height of my programming knowledge was using Fortran and Pascal in the ‘80s!) There are, however, many highly skilled developers that can do almost anything with the AutoCAD API (Application Programming Interface). I frequently refer readers to Lee Ambrosius at hyperpics.com (especially for sheet set development). He is an authorized Autodesk developer and author with a tremendous amount of experience at customizing AutoCAD. Lee was kind enough to offer a response to Tannar’s question… and it doesn’t even require programming!

You can use the system variable field and the CTAB system variable to achieve a field with the current layouts name in it.  Both Publish and Plotting accept this method and works great for this reason.

To create the field:

  1. Display the Field dialog box.
  2. Select Other from the Field Category drop-down list.
  3. Select SystemVariable from the Field Name list.
  4. Select ctab from the System Variable list.
  5. Optionally, select formatting for the value from the Format list.
    Field_ctab
  6. Click OK.
  7. Rename the layout and regen the drawing.  Both the layout tab and the field should be in sync.
  8. Create a new layout and regen the layout and the new layout name will be displayed in the field.

Thanks to Tannar for his Good Question and to Lee for his wonderfully simple solution! To learn more about the many valuable services Lee can offer, check out these resources:

Lee Ambrosius, co-author of: AutoCAD and AutoCAD LT All-in-One Desk Reference for Dummies
HyperPics LLC, hyperpics.com
Beyond the UI, hyperpics.blogs.com
Online Forums, hyperpics.com/csforums/

February 1, 2007 in Good Questions | Permalink

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/549785/7732667

Listed below are links to weblogs that reference Good Question: Layout names and fields: