Converting External Reference Path Types with Action Macro’s

In my last blog post I wrote about the new External Reference tools you (probably) didn’t know about in AutoCAD 2014. As someone who uses external references nearly everyday, it goes without saying these new features are among my favorites in this release. More specifically, the ability to convert full path references to relative path references has proven invaluable.

Automating External Reference Path Type Conversion

Although the External References Manager does a great job at allowing you to convert the path type of individual references, what if you have multiple references you would like to convert at once? The easiest way to accomplish this is with the new PATHTYPE function within the -XREF command. I briefly suggested using this function for the purposes of scripting, but the good news is you can take advantage of this function even if you’re not familiar with scripting AutoCAD.

Introduced back in AutoCAD 2009, another frequently forgotten feature of AutoCAD is the Action Recorder. The beauty of the Action Recorder is that you can start automating certain functions within AutoCAD even if you know nothing about scripting or programing. I find the Action Recorder especially useful for automating simple routines like converting full path references into relative path references.

Creating an Action Recording

Automating such a procedure is easier than you might think:

  1. Navigate to the Manage Ribbon tab, and click the Record button within the Action Recorder panel.
    Doing this will start a new Action Recording meaning anything you do in AutoCAD will be recorded for playback later.

    Creating a new Action Recording

    Creating a new Action Recording

  2. Type -XREF and press Enter to start the command-line version of the external references command.
  3. Choose the pathType function

    Choosing the PATHTYPE function at the command ine

    Choosing the PATHTYPE function at the command ine

  4. Enter * the designate all external references at the Enter xref name(s) to edit path type: prompt.
  5. Choose the Relative function at the Enter new path type [Full/Relative/None]: prompt.
  6. Click the Stop button within the Action Recorder panel on the Manage Ribbon tab.
  7. Stopping an Action Recording will open the Action Macro dialog. From this dialog you can specify how this recording will perform the next time you play it back. In this example I’ll name my Action Macro C2RPATH, and uncheck Check for inconsistencies when playback begins.
  8. Click OK to save your Action Macro.

Applying Action Macro’s

Action Macro Configuration

Action Macro Configuration

After creating an Action Macro you have a couple options for actually using it. Perhaps the most obvious method is to click the Play button on the Action Recorder panel of the Manage Ribbon tab. While this method works, it does require you to switch to the Manage Ribbon tab.

A lesser known method for playing back Action Macros is to enter its name at the command line. I named my Action Macro C2RPATH in the example above. Since Action Recordings also function as AutoCAD commands, that means I can also play my external reference macro by entering C2RPATH at the command line.

About Donnie Gladfelter

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

  • P Clarke

    I wrote a similar Macro (by hand) with 2014LT and it doesn’t seem to change the path type for XREF’s that are images (only ACAD drawings). Have you experienced this too?

  • http://www.viatechnik.com/ Anton Dy Buncio

    Great post! Thanks for the clear step-by-step, Donnie.