Data Links are a great way to link tables in AutoCAD with Excel spreadsheets. If you update the Excel file you’ll most likely get a warning in AutoCAD that the file has been updated and needs refreshing. However, the data link always has to be updated manually. Always. Even if you just opened the drawing.
So, what happens when you need to publish multiple sheets that all contain Data Links? Out of the box you’d have to open each file and manually update the Links. Today a client called me with this exact problem and I figured I could probably solve it with a tiny bit of LISP. It worked, and I thought it would make an excellent short post.
To make Data Links update automatically:
- Locate the acaddoc.lsp file located in your user based support folder. Here are some default locations. If you don’t see the file just create it using Notepad.
- Win7: C:\Users\myUN\AppData\Roaming\Autodesk\C3D 2010\enu\Support
- WinXP: C:\Documents and Settings\myUN\Application Data\Autodesk\C3D 2010\enu\Support
- Open acaddoc.lsp in Notepad. Be sure it’s acaddoc.lsp and there are no numbers in the filename! Add the following line to the file:
(command "DATALINKUPDATE" "U" "K")
- Save the file.
Now, every time you open a drawing all the Data Links in it will update. To take advantage of this fact with the PUBLISH command just be sure NOT to publish in the background. If you don’t publish in the background, acaddoc.lsp runs on every drawing being published.