Automate Sheet Setup with Action Macros

Although there’s no shortage of ways to customize AutoCAD, nearly every one requires some familiarity with programming. Given the barriers of learning a programming language, I find so many of the AutoCAD users I come across simply survive with the tools they already have verses learning to create new ones. This is the fundamental reason I love Action Macro’s so much; they allow users, with or without programming experience, to create new AutoCAD tools in an instant.

The beauty of Action Macros is the way that anyone who can use the command line inside AutoCAD can also customize AutoCAD. Given how simple they are to create, I have found a wide range of ways to create and apply Action Macros over the years. One of my longtime favorites is using them to automate the setup and creation of new drawing sheets.

The best way to ensure all of the sheets for a project plot the same is to create every sheet from a common layout template with the same page setup applied. While the procedure for doing this isn’t especially hard, it does involve several steps, and frequently becomes cluttered among the library of different sheet sizes used by most companies (Letter, Ledger, Arch D, etc). Using Action Macros I can dramatically simplify this process by creating a series of custom commands that will automatically create a new layout tab at the desired size.

To create an Action Macro that will generate new layout tabs per your companies standards:

  1. Switch to the Manage tab on the Ribbon, and then click the Record button on the Action Recorder panel.
  2. After starting a new recording, enter the following at the command line:
    Recording an Action Macro
    Recording an Action Macro

    FILEDIA <enter> (This will suppress file-browser dialogs)
    0 <enter>
    -LAYOUT <enter> (Notice the hyphen. This command will import a Layout tab from another drawing)
    T <enter> (This chooses the Template option)
    Path to your template <enter> (Enter the path & filename of the drawing template containing your layout template)
    Enter the name of your layout. <enter>
    FILEDIA (This restores this value to it’s pre-macro value)
    1 <enter>

  3. After entering the above sequence, click the Stop button on the Manage tab > Action Recorder panel.
  4. A new Action Macro dialog will open after stopping the Action Macro recorder. Here you will give your macro a name; the name you choose will double as a new command inside AutoCAD. For this reason, I like to choose something like NS1117for New Sheet 11 x 17.

    Saving your Action Macro
    Saving your Action Macro

After saving your Action Macro test it by entering its name at the command line. In the example above, I named my macro NS1117, so I’ll enter that at the command line. In addition to the creation of a new Layout tab, a Playback Complete dialog will also open to confirm the macro was correctly executed.

Playback Confirmation
Playback Confirmation

 

Donnie Gladfelter
Donnie Gladfelter

Donnie is author of the book and Autodesk Official Press, AutoCAD and AutoCAD LT: No Experience Required, a columnist for AUGIWorld Magazine, Autodesk University speaker, and former member of the AUGI Board of Directors.

4 Comments

  1. I have a structural detailing program that works with autocad it makes the drawings as DXF files they will not keep any setup information. I have to open each file setup for PDF files then setup for 11×17 for printing on my printer. I can have over 100 drawings to do this to. So one at a time is takes a lot of time.
    Roy Eccles

  2. Hi this was really useful…actually am about to create cad template with specific size,title block and layer setup …is this possible..could you please help to find out solution.

  3. If you need save the macro with a longer, more descriptive name you can edit your acad.pgp file to make a shortcut for it.  Or for the mouse people, I suppose you could make a button to click too.

    Another trick is to edit the file location where the macros are saved, and point it to a shared network location.  Set it the same for others in the office, then anyone can access a macro that someone else has recorded.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: