Hello,
I am working ini a tool to extract blocks and its information from an imported CAD file.
I paste a piece of code and I hope that it helps you
Reference refer = selection.PickObject(ObjectType.Element, "Select a CAD Link");
Element elem = doc.GetElement(refer);
GeometryElement geoElem = elem.get_Geometry(new Options());
foreach (GeometryObject geoObj in geoElem)
{
GeometryInstance instance = geoObj as GeometryInstance;
foreach (GeometryObject instObj in instance.SymbolGeometry)
{
if (instObj.GetType().Name == "GeometryInstance")
{
//IT IS A BLOCK
}
}
}