I am trying to retrieve the references to the faces of a beam. I need this to display analysis results on these faces.
I tried using:
Element.Geometry
GeometryInstance.GetInstanceGeometry as Solid
but then Solid.Faces was empty.
I was more successful trying GeometryInstance.GetSymbolGeometry. I retrieved faces, but could not get references to these faces.
I need references and not just faces, because when I use SpatialFieldManager.AddSpatialFieldPrimitive(Face, Transform) the analysis colors does not display correctly - the "analysis gradient face" and actual face overshadows each other - I am not sure how to describe it, the same things happens when you have a duplicated element with different colors.
Solved! Go to Solution.
Solved by Joe.Ye. Go to Solution.
Some time for an element, you can retrieve several solids via geometry retrieving API methods . Some of them are valid solid, and some of them are invalid. You need to go through all the returned solids to check if it is valid by checking if Solid.Faces.Count is greater than 0.
To get the reference of a face, you need to set the Options.ComputeReferences = true when retrieving geometry data via Element.Geometry() property.