It works, thank you so much !
But I'm not sure that I'm using it correctly. Here is my code:
UIApplication uiApplication = cmdData.Application;
UIDocument uiDocument = uiApplication.ActiveUIDocument;
List<double> listData = new List<double>();
Options geoOptions = uiApplication.Application.Create.NewGeometryOptions();
if (geoOptions != null)
{
geoOptions.ComputeReferences = true;
geoOptions.DetailLevel = DetailLevels.Fine;
}
List<Element> elements = new List<Element>();
FilteredElementCollector collector = new FilteredElementCollector(uiDocument.Document).WhereElementIsNotElementType();
foreach (Element e in collector)
{
if (e.Category != null && e.Category.HasMaterialQuantities)
{
elements.Add(e);
}
}
foreach (Element elem in elements)
{
GeometryElement geoElement = elem.get_Geometry(geoOptions);
// Get geometry object
foreach (GeometryObject geoObject in geoElement.Objects)
{
// Get the geometry instance which contains the geometry information
GeometryInstance geometryInstance = geoObject as GeometryInstance;
if (geometryInstance != null)
{
foreach (GeometryObject instObj in geometryInstance.SymbolGeometry.Objects)
{
Solid solid = instObj as Solid;
if (solid == null || solid.Faces.Size == 0)
{
continue;
}
Transform transform = geometryInstance.Transform;
// Get the faces from solid
foreach (Face face in solid.Faces)
{
Mesh mesh = face.Triangulate();
foreach (XYZ point in mesh.Vertices)
{
listData.Add(point.X);
listData.Add(point.Y);
listData.Add(point.Z);
}
}
}
}
}
}
What about getting information about the Transformation ?