Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Retrieving references to faces of a beam

1 REPLY 1
SOLVED
Reply
Message 1 of 2
PatrickEC
939 Views, 1 Reply

Retrieving references to faces of a beam

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.

1 REPLY 1
Message 2 of 2
Joe.Ye
in reply to: PatrickEC

 

 

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.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community