Message 1 of 5
Beam/Column Faces Error

Not applicable
12-04-2018
05:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I'm trying to retrieve geometry data from an array of elements (walls, floors, columns and beams). When I use my algorithm with the walls and floors, there is no problem to get the Solid of the element.
Options opt = new Options();
opt.ComputeReferences = true;
foreach (Element e in listaElementos) { GeometryElement geoElement = e.get_Geometry(opt); foreach (GeometryObject obj in geoElement) { Solid geomSolid = obj as Solid; foreach (Face geomFace in geomSolid.Faces) { XYZ centroide = geomFace.Evaluate(new UV(0.5, 0.5)); // Se hace el chequeo para identificar el que está más arriba if (centroide.Z > ptoMasAlto) { puntoMasAlto = centroide; ptoMasAlto = centroide.Z; ide = e.Id; } // Se chequea cuál está más a la izquierda XYZ nuevoCentroide = new XYZ(centroide.X, centroide.Y, 0); XYZ comparacion = rle.PointOntoPlane(planoVista, nuevoCentroide); // Se compara la direccion de los vectores para obtener el que está más a la izquierda. XYZ vectorComp = (comparacion - izqPlano); double anguloComp = doc.ActiveView.RightDirection.AngleTo(vectorComp); if (Math.Abs(anguloComp - 0) > 0.1) { izqPlano = comparacion; puntoMasIzq = centroide; } } } }
But if I see what element is stored in my "listaElementos" list for beams and for columns there is a "FamilyInstance" element. Using the above code I get "null" when I ask for its solid and from then, it crashes.
Any tip of advice on how to get the faces for my columns and beams will be very appreciated.
Regards!