Ready, Set, Action! Learn How to Create Action Macros in AutoCAD

Learning
action macros in AutoCAD

Action macros are a series of actions (commands) that you record and can be played back in an active drawing. You use the Action Recorder to save the commands as an action macro (.ACTM file). Using action macros can really increase productivity by automating repetitive tasks.

As you perform commands in a drawing, you record your steps as action macros. Then you can play the macros as needed to repeat the performed steps with minimal input. Using an action macro is just like typing in an AutoCAD command that you define and entering the name in the command line. Due to this functionality, it is crucial that you do not create an action macro with the same name as a default AutoCAD command.

Let’s take a look at the Action Recorder, how to create action macros, and some examples.

Action Recorder

So, where do you find the action recorder tools and settings? Navigate to the Ribbon: Manage tab > Action Recorder panel.

Action Recorder AutoCAD

You will notice that there is a big button to start the recording, and other tools that allow you to manage and play your action macros. As you create action macros, they will appear in the action macro drop-down.

action macro drop-down AutoCAD

As I always tell users, there is no “magic” when it comes to AutoCAD, there’s always a setting or file that it reads or locates AutoCAD resources. .ACTM files are stored in the following location and are accessed in the Options dialog box.

ACTM files AutoCAD

You will notice that there is an additional Action Recorder location that you can define for multiple locations. This allows you to place your .ACTM files on the server to share with all the users in your company. (Very cool!)

How to Create an Action Macro

Hmm, I wonder which button you hit first to start recording an action macro… Yep, it’s the BIG Record button in the Action Recorder panel.

While AutoCAD is recording, you can launch commands, enter values, and even select objects. The Action Recorder records standard commands from the command line as well as from the ribbon, the Properties palette, the Layer Properties Manager, and the tool palettes. That said, most dialog boxes are not recorded in the Action Recorder unless you use the command line equivalent of the dialog box setting; that would be entering a dash “-” before a command (e.g., -INSERT).

Once you start the Record process, try to do ONLY the commands that you need to do for the macro, including zooming. Remember, AutoCAD is recording EVERYTHING while you are “recording.”

When you start recording, you will notice that AutoCAD puts a record badge at your cursor, visually telling you that you are recording a macro. Also, the panel will expand to show you everything that you do in AutoCAD.

When you have completed the steps, click the Stop button to finish the recording. You will be prompted to give the macro a name. Remember, do not use a default AutoCAD command, as this will override that command. As a tip, I will either give the macro a prefix with my initials or the company.

Action Macro command name AutoCAD

Now, once the macro is saved, you will want to navigate to the commands in the Action Recorder panel. There you can edit certain locations in the macro to provide either a Pause for user input, to remove any accidental commands, or to insert a user message. To access those options, you simply right-click on any of the commands and choose from the context menu.

Action Recorder panel AutoCAD

And that’s it! All you have to do is type the command in the command line and you now have your own custom command.

custom command AutoCAD

Action Macro Examples

So, what are some examples of action macros? Actually, it’s really infinite as the action macro can be very elaborate or simple. That said, here are some examples of action macros that I use throughout the day.

Rotate the View to A User-Defined Rotation

This macro allows the user to rotate the view to a rotation defined by the user, and then sets the UCS back to World. Very useful in the civil realm.

rotate view action macro AutoCAD

My ATTSYNC Command

When re-defining attributes in a block, you have to run the ATTSYNC command, press “S,” select your block, and then press “Y” for yes. This macro, simplifies this process to two clicks.

ATTSYNC command AutoCAD

My PURGE

Purging can be straightforward, but this macro automates it completely. It also adds the purging of REGAPPS, which is not in the default PURGE command.

action macro PURGE command AutoCAD

And the list can go on and on. Now, go create your own macros!

Try AutoCAD free for 15 days
The AutoCAD Blog is all about helping you get the most out of AutoCAD. It's also the best way for you to connect with the makers of AutoCAD. Subscribe to keep up with AutoCAD