So you’re working on a high-rise residential project and you’ve been assigned the task of coordinating all the mechanical systems with your unit layouts. Sounds like fun. Problem is, you’re working under a deadline and need to make changes fast before you issue drawings at the end of the week. You’ve got a killer Revit model but unfortunately, your MEP engineers aren’t working in Revit. Instead, they send you their latest duct layouts in DWG format.
The building is 60 stories tall and each floor plate is slightly different. You can’t link one DWG file and copy it to all the levels. You need to link a unique DWG for each floor level. It takes you about a minute to link one drawing so you’re looking at over an hour just to link all the floor plans. That’s time you’d rather spend getting your work done instead of clicking the mouse and selecting files. Revit doesn’t allow you to link more than one file at a time. So what are you going to do?
Link Multiple DWGs
What you need is some way to automate linking of multiple DWG files into your model. Fortunately, this is easy to do using a Revit macro.
The following Revit macro reads a CSV file containing DWG file paths and Revit views.
In the CSV file, the “File Path” column contains the full paths to the DWG files. The “Floor Plan View” column contains, you guessed it, floor plan views.
The macro first reads the CSV file then it loops through the data and inserts each DWG onto the level of the specified view. The macro checks that each DWG exists in the specified location. If it can’t find the file, Revit will give you a warning. Similarly, the macro checks that each view exists in the current project file. If it can’t find the view, the macro will give you a warning.
The macro links the files using the black and white color mode and places matches the DWG’s origin to the model origin. Insertion units are set to the default value of the model file. All of these settings can be changed by editing the “curOptions” variable in the macro code.
Download the Macro
The macro is written in VB.Net. When you run the macro, you can select the CSV file containing the file paths and the view names. You can also specify if you want to link or insert the DWGS. I highly suggest you link the files but there may be some occasions when you want to import. Keep in mind that importing will greatly increase the file size of your Revit model.
You can download the macro (in Revit 2014 and 2015 formats) from the ArchSmarter Revit Macro Library. To access the library, sign up for ArchSmarter updates in the form below.
Let me know what you think about the macro and leave comment in the box below.
I’ve try to prove this macro, but I’ve have a problems. I wonder if the macro works with Revit 2016 or 2017.
There’s a version of the macro in both 2016 and 2017 formats. What’s the issue you’re having? Are you getting an error when you run the macro?
“Could not create link for file” – any ideas. The macro looks great. Just can’t get it to execute properly.
Barry,
Sorry about that. Could you send me the CSV file you’re using (michael at archsmarter dot com)? I’ll take a look. Sometimes there are formatting issues in the spreadsheet that cause errors.
Michael
Very interesting! I usually use this: http://www.coreldraw.com/en/pages/dwg-file/ to open and edit .dwg files but this looks interestind so I could give it a try
I know this response is late but couldn’t you just create an autocad master file and xref “attach” the files into it then link that master into revit. That should pass all the files into Revit and keep the amount of files in your CAD links to a minimum. Then you could just schedule a script to open and save that master file every night or what ever frequency you want to refresh the content xref content.