Get cad block attributes in dynamo

Is there a way to read cad block attributes in dynamo?
I am trying to place family instances based on cad import and transfer the values in the cad block attributes to the family parameters.

Are you using Revit or Civil 3D?
Please also provide additional illustrations

1 Like

I am using Revit 2024 and I need to transfer the attributes in the attached photo to Revit family parameters with the same name.
Capture

So my own research has has found that Revit cannot read CAD data at time of writing this (Hopefully sometime in future it can!!!). There is also mention of using add on packages like linkdwg, linkdwg2 and bimorph… to name a few that can read CAD data. I was unsuccessful with the add on packages as could not get the nodes to work in a way that would of been satisfactory as I’m new to Dynamo.

I then approached this from a different angle as the cad blocks could probably be exported to a spreadsheet, and Dynamo OOTB can read spreadsheets. This simple Graph can then create the elements required within Revit based on the data of Revit

Handy links:

Sample End Goal Screenshots



Files:
Sample Cad.dwg (36.3 KB)
Sample Excel.xlsx (15.3 KB)
Sample Place.rvt (6.3 MB)
Place Family at Coordinate.dyn (55.7 KB)

Any Suggestions, Fixes, or Query welcome as there’s more than one way to skin a cat. :slight_smile:

Hopefully this helps those trying bring Cad Blocks into Revit

Kudoos for the method,
I’m wondering, how to deal with Blocks created with their 0.0.0. way off
I struggled with that working on the model of Geneva airport. (many Point cloud and Cad files)
That Cad file was imported from some French Software and than to AutoCad.
Do you use Cad Geometry to a Dynamo Geometry and a transform method, to solve this??

1 Like

Exported the blocks to excel and then Dynamo creates the elements based on data specified in the spreadsheet. Probably a bit long winded not using CAD within Revit, but as I stated I’m new to using Dynamo.

See sample files attached in my previous post

Let see what happens in this thread
There are some very creative people here

It can. Revit can import a DWG so we know it can. The question is ‘how do we make it work programmatically’ and the answer is ‘very carefully and with great difficulty’. The reason for this is that the Revit API can’t readily wrap the DWG libraries files for ALL THE THINGS which we might want as Revit users without basically creating an API as complex as the AutoCAD API which is intense. But to enable user add-ins to interact with DWG content (and likely some internal Revit capabilities) there is a copy of the code AutoCAD API library (acdbmgd.dll) provided with Revit installations. This makes things attainable, but not without difficulty (search the forum for Revit topics which use that DLL in Python and you might see some examples).

So while doable the degree of difficulty is significant enough that personally I wouldn’t bother - put simply there are better methods out there for customizable interoprability scopes which provide greater levels of flexibility and control that what you can attain at scale now. To list some of the Autodesk solutions which are relevant to the forum: DataConnector and associated APIs in APS, Data.Remember node, StringifyJSON node, Civil Connection and multiple other Dynamo packages, the DataExtraction in AutoCAD and excel/csv imports in Dynamo.

I posted on a few of these recently - but I recommend looking at the Dynamo Blog for the post on using the Stringify JSON method in combination with Dynamo for Civil 3D and Dynamo for Revit.

1 Like