Revit DWG Link: Does it really import an AutoCAD "Drawing", or just Geometry?

Looking for a way to bring AutoCAD Groups into Dynamo. Here is an example of what I mean:


Note the “Group = A1” associated with both lines.

If there was a way to generate a list of geometry by Group, it would make it easy to create Revit wall elements directly from a CAD file. I have a graph that, once a line pair is identified, will generate a centerline for the wall location and derive a wall thickness indexed to a corresponding family type. Add that to my stair, door, column, floor and room/area modules, and you have a nice building level, all programmatically created with the geometry exactly like the asbuilt floor plan.

Unfortunately, there seems to be no way to pair up all the lines programmatically, no matter how many sorting, grouping, ClosestTo nodes I strung together. It also requires a lot of work prepping the CAD file. Having that Group reference would let you only select wall lines and group them. Know any AI or machine learning nodes that can do this on a complicated floor plan?

If Revit truly imports CAD drawings, then wouldn’t Group dictionaries be included? Nothing I could find in the Revit API gave any clues either way:


It says DWG file, not “curves”…

In another post, I asked for help with a ZT node that theoretically could do this directly from CAD. I don’t care how it’s done (Python script?), just want my Groups!

Any insight is appreciated.


Data is lost any time you translate it between applications. As Revit doesn’t have a direct conceptual partner to Autocad’s groups that data is likely lost, though I can’t say for certain as groups like this are something I haven’t used before.

Would likely be really easy to convert the groups into a block via some method of AutoCAD automation, and then save the file. When that’s imported into Revit each block will be sub-selectable and therefore should be easy to automate the data you’re after.

That said, if you’re really just after the width and centerline of the walls there is likely an easier way to accomplish what you need. have you tried pulling the data from the DWG with the data extraction command? Once you have the line’s start, end, and width you can easily create walls in Revit.

Hi @JacobSmall,
Sub-selectable? Interesting. I looked into blocks, but couldn’t figure out how to associate block name with the entities (curves, et al). How is that done? You can see the block name in Revit when queried, but it doesn’t end up in Dynamo.

“Block1” appended to the dwg file. I assume in case of multiple links:

No block info, at least with existing packages, in Dynamo:

Groups name themselves when created, which is nice, but of no use to me if they don’t make it over. I really wish the AutoCAD and Revit folks would get together and hash it out!

Early on, I was using Data Extraction; manipulating, then importing the excel file into Dynamo, but it was too much work. The LinkDwg and Bimorph nodes get the geometry easily, but nothing else.

Here is what comes out when running the data extraction for the same two-line block:

As you can see, the block has it’s own row and there is no reference to the lines. Imagine 100s of blocks. Yikes! The AutoCAD people need to step up their game on this tool. Has it changed any since the 90’s? If they showed half the metadata you get from a simple Lisp command, it would be way more useful. I edited the table to include only relevant categories, but you get the idea.

But the data isn’t usable as-is. You have to create the center line between the two wall lines and measure for thickness, then put those center lines in their respective layer (named after the wall type). After doing it manually for a week, I almost gave up. Almost…

My current graph does everything but only selects about 80% of parallel wall line pairs. It really has to be done manually (hence the Group), but I’ll take it in lieu of all the other prep work. So close!

CAD_ParametricWall.dyn (565.6 KB)

To be clear, this is part of an effort to create models for hundreds of buildings that are in our portfolio. I am not kidding. To create them all by hand would take decades.

The only way it’s even possible is the standardized floor plans. I can use one Revit template and automate most everything else. This line group thing is my holy grail!

So, if you know a way to use blocks, I will definitely check it out.
Absent that, the Python script from this thread is promising. I am also struggling with a ZT node that would do the same thing. Maybe going through Revit isn’t the answer?

Appreciate the reply. I have learned from many of your suggestions and explanations on this forum.




Something to try, once blocked in the DWG:

  1. New 3D view, disable all visible elements
  2. Import DWG into view
  3. Explode DWG to get sub-blocks
  4. All elements in active view
  5. Element.Curves
  6. Curve.PointAtParameter to get the start, mid, and end parameter points of each curve.
  7. List.Flatten @L3 to get the list’s of each group
  8. Line.ByBestFitThroughPoints

I think you are on to something. Had ruled out importing and exploding in Revit because the LinkDwg method seemed better (and all the articles that say not to), but a partial explode retains the blocks! Dynamo totally paired those lines up.

The Line.ByBestFitThroughPoints didn’t work for me, as it likes to go crosswise. But, when I hooked it up to my centerline and wall dictionary groups it worked. I will need to separate the Arc pairs, but I have a module for that. Also, before blocking the pairs, the line directions need to be the same. I used AUTO-BLOCK.lsp and it worked like a charm.

This is a HUGE breakthrough (right under my nose, of course).
My graph is now half the size. Will post a finished product once it is ready. Thank you so much! Once again, I am pulled from the brink of failure.




No such thing as failure with this type of stuff l. Just thing you have a solution for already and things you don’t yet, but may be found sooner or later. :slight_smile: