Is it possible to get autocad block attribute from link CAD?

Is it possible to get autocad block attribute from link CAD?

Anonymous
Not applicable
1,567 Views
2 Replies
Message 1 of 3

Is it possible to get autocad block attribute from link CAD?

Anonymous
Not applicable

Is it possible to get autocad block attribute from link CAD?

 

изображение_2021-03-23_160202.png

 

I use code from here . 

I get original , geometry and rotation, but I can not get attribute.

0 Likes
1,568 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

You should be able to determine this yourself using the element lister and RevitLookup:

 

https://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-onto...

 

List all BIM elements, add the block, list the BIM elements again, determine the newly added objects, and explore them and their properties using RevitLookup.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

jeremy_tammik
Alumni
Alumni

I stand corrected... I read the existing thread on getting to text objects within an imported DWG:

 

https://forums.autodesk.com/t5/revit-api-forum/get-to-text-objects-within-imported-dwg/m-p/5344375

 

It was pointed out by Matt in the thread on getting attributes from import CAD block:

 

https://forums.autodesk.com/t5/revit-api-forum/getting-attributes-from-import-cad-block/m-p/10179309

 

It explains that there is no direct access to text entities or attributes contained in the DWG file.

 

Workarounds:

 

  • Explode the DWG to create TextNote elements
  • Export the DWG to DXF and parse the resulting text file for the required data
  • Use the AutoCAD.NET API to read directly from the DWG

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open