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: 

Determine outer surface of Element

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
jasonkhc
929 Views, 7 Replies

Determine outer surface of Element

Hi,

 

I would like to seek for advice on how to get the outer surface of Revit Element (Slab, Beam). 

There are many opening and profiling inside the element.  

 

how should I determine which face is exposed externally and which face is not?

 

Very very appreciate if anyone can help me.. being stuck in this thing for a month~

7 REPLIES 7
Message 2 of 8
jeremytammik
in reply to: jasonkhc

Dear Jasonkhc,

 

Happy New Year to you!

 

Thank you for the interesting query.

 

If the element shape is convex, you could quite easily determine what you need by forming the convex hull and then comparing each face with that.

 

If the holes in the element are generated by intersections with other elements, then the Element.GetGeneratingElementIds method and GeometryObject.IsElementGeometry property may help differentiating.

 

Other than that, I would say that you simply have a normal non-trivial general geometric problem to solve, and the Revit API cannot help much with that.

 

Please let us know how it goes.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 8
jasonkhc
in reply to: jeremytammik

I am able to get outer surface using my own concept but i still cannot determine which surface is on top or bottom .. cuz there is some odd angle and it causes the vector not consistant as 0,0,-1 or 0,0,1.. all XYZ normal now have value.. ><

Message 4 of 8
jeremytammik
in reply to: jasonkhc

Dear Jasonkhc,

 

If you are expecting a 'top' and 'bottom' surface with normal vectors close to the positive or negative Z axis, I would say that you are in luck and your problem is completely trivial.

 

Simply determine the angle between the normal vector and the Z axis. If the angle is below a certain (possibly small) threshold, you can consider the surface a top or bottom one.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 8
Revitalizer
in reply to: jasonkhc

Hi jasonkhc,

 

note that PlanarFace.Normal does not reliable give you a vector directing outwards.

Revit.chm says: "This property is the "surface normal" vector. This is not necessarily the normal vector pointing out of the solid that contains the face, to get that value use ComputeNormal(UV)."

 

May this be an explanation for your odd vectors ?

 

 

Best regards,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 6 of 8
jasonkhc
in reply to: Revitalizer

how would i use ComputeNormal(UV) as i still need the UV coordinates right?

Message 7 of 8
Revitalizer
in reply to: jasonkhc

Hi Jasonkhc,

 

planarFace.ComputeNormal(new UV(0.5,0.5))

 

Best regards,

Revtalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 8 of 8
jasonkhc
in reply to: Revitalizer

Thank you very much, you guys are very helpful ^^

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