Workflow: Import Geometry to Dynamo from CAD Link

I had a simple question recently: How do I get some DWG or DXF geometry into Dynamo to do some simple tasks, like placing families at points in Revit?

I looked for the DWG import nodes, until I realised they only come with Dynamo Studio. Then I realised that Dynamo Studio doesn’t run on top of Revit. Weird, huh?

Then, I came across this little offhand comment from John Pierson:
You can import in Revit> select file> and query geometry.

It can’t be that easy, can it? Yes, it can!

Just like this:

So, by simple selecting the Link or Import element in Revit, we can use Element.Geometry to unpack its geometry. This method would likely work with any other CAD format that Revit can Link or Import, such as SAT, SKP or DGN.

I had tried some more challenging workarounds like going via Flux, but sometimes the easiest option is the best.

Get.CategoryName

This node will attempt to report the Category Name of an element or list of elements.

It does not work for every element, but the underlying Python code is lightweight and generally quite fast:

cat_python