A while back, I was working with a client to convert some of their office standard wall types to Revit. I created new wall types to match their standard wall type details. I also had to convert these standard details to Revit. The details were drawn in AutoCAD so I had a few options:
- Import the details into a Revit Drafting View, explode them and convert the elements to Revit line styles.
- Link the details into a Revit Drafting View and change the visibility and line styles of the elements
- Trace the linked details in Revit using this method.
Since these details were going to become office standard details, I needed them to be really clean. I didn’t want to clutter up my Revit files with lots of extra line and text styles and I didn’t want to manage a whole lot of links. With this in mind, I choose option 3 and thus began several days of tracing line after line after line. It was really tedious, to say the least. A few days later, I had a clean set of Revit details.
At that time, I didn’t have a way to automate this process. I had to manually redraw the details, using the linked CAD file as an underlay. I had to do a similar exercise recently. However, this time I was determined to figure out a way to automate the process.
Convert DWG to Revit Macro
Who wants to manually trace lines when you can have Revit do it for you?
The “Convert DWG to Lines” macro prompts you to select a linked or imported DWG file. The link or import can be in any type of view. Below is a screenshot of an AutoCAD roof detail that’s been linked into a Revit drafting view.
The macro prompts you to select a linked or imported DWG file. Once you select the DWG file, the macro will access the geometry in the file and create a new Revit line or arc using that geometry. Once it completes the conversion, the macro will let you know how many elements from the CAD file were converted to Revit elements.
The macro creates detail lines so they are only visible in the current view. Also, the macro creates the lines using the “Medium Lines” line style. You can edit the macro code to use any line style you prefer. Just change the value of the “linestyleName” variable as highlighted below.
Just make sure you specify a line style that exists in the current project file. The macro checks that the line style exists and will give you an error if it doesn’t.
Below is a view of the converted AutoCAD file with the linked file removed.
As you can see, the macro does not convert AutoCAD text to Revit text. The ability to read AutoCAD text is currently not available in the Revit API. When you use the macro to convert your AutoCAD details, you will need to add the text manually. It will convert leaders and dimension strings, but not the text associated with those elements. The same goes for hatch patterns. The macro does not convert them to Revit fill patterns (at least not yet).
Download the Free Macro
You can download the macro from the ArchSmarter Revit Macro library. Don’t have access? Sign up for ArchSmarter updates in the form below and get immediate access to this and other time-saving Revit macros!
Need More Power?
Check out Power-Pack for Revit. This Revit add-in includes 7 of the most popular ArchSmarter macros, including a more advanced version DWG to RVT. Convert your DWG to detail lines, model lines, area boundaries, room separation lines or space separation lines. Read more about Power-Pack for Revit.