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.
So, where do you find the action recorder tools and settings? Navigate to the Ribbon: Manage tab > Action Recorder panel.
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.
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.
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.
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.
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.
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.
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.
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.
And the list can go on and on. Now, go create your own macros!