Determine outer surface of Element

Determine outer surface of Element

Anonymous
Not applicable
1,475 Views
7 Replies
Message 1 of 8

Determine outer surface of Element

Anonymous
Not applicable

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~

Accepted solutions (3)
1,476 Views
7 Replies
Replies (7)
Message 2 of 8

jeremytammik
Autodesk
Autodesk

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

0 Likes
Message 3 of 8

Anonymous
Not applicable

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.. ><

0 Likes
Message 4 of 8

jeremytammik
Autodesk
Autodesk
Accepted solution

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
Advisor
Advisor
Accepted solution

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

Anonymous
Not applicable

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

0 Likes
Message 7 of 8

Revitalizer
Advisor
Advisor
Accepted solution

Hi Jasonkhc,

 

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

 

Best regards,

Revtalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 8 of 8

Anonymous
Not applicable

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

0 Likes