Get top face of an element

Hi,

I’m trying to get the area of the top face of certain beams.
I was searching in the forum similar cases by I did’n find anything.
I think a good approach is to get every face of the element and filter the face with bigger Z coordinates. Or maybe get the file surface with an upwards orientation and bigger surface.

Does anybody tryied to do something similar?

Thank you.

@JC.Moreno ,

try groupByKey or sort by Key

i would take a other reference than area f.e. name … Area can accidently sort something else…

KR

Andreas

Both of those are the most common solutions. You just have to know what your geometry will look like and any outliers you need to be prepared for. Give them a shot and see what you get.

2 Likes

You can also get the surface vectors and filter to the ones that are parallel to the Z axis. This will get you the top and the bottom. Then from that just get the one that has the highest z coordinate value. Normally, we give guidance and let the poster work it out and we help where needed. But it was easier to show you the approach also. I do have to clarify, that this only works if the surfaces are flat and parallel to the axis.

5 Likes

Hi @staylor,

Thank you for helping. I was trying to use the Plane.Normal node but it didn’t work.


Thank you for your advice to use Surface.PointAtParameter.

The areas seems to be multiplied by a factor of 1.5. Do you know why?
I’m working in Universal not in Imperial.

You can also use the Surface.NormalAtParameter node to get the vector direction of the surface. However, if you need to get the plane for some other reason, then you can use this.

I don’t know why your surface areas are being increased. Sorry!

I think the problem is related to Dynamo units are in inches.
However, I don’t think 1.5 is the factor of conversiont between squared inches and squared cm.
I’m gonna create another post.


Thank you very much for you help.

1 Like

But this workaround will only work for those girders which top surfaces are parallel to the XY plane, right? I mean, flat girders with no longitudinal slope.

@JC.Moreno , I suggest taking the girder centreline and creating planes perpendicular to that centrelines. After this, the intersection between the girder faces and the vertical planes will give you a line per face. You get Curve.ParameterAtPoint(0.5) and then you get the highest Z coordinate point.

Here is another option :slight_smile: This one tries to catch edge cases where your beam may be vertically diagonally placed.

JCMoreno_GetTopFaceOfAnElement.dyn (31.2 KB)

3 Likes

Hi, the damn special case, although in the question one can suspect the top face of the element
(mandatory double filtering to eliminate in the case of inclined beams)

cordially
christian.stan

1 Like

Hi, only if the beam is keyed to the top face in the dialog (tilted or flat)

cordially
christian.stan

@christian.stan @JMCiller That’s correct. That’s why I stated that in my post that was marked as the solution.

I do have to clarify, that this only works if the surfaces are flat and parallel to the axis.

1 Like

I had seen don’t worry :wink:, here it’s a solution provided you have (the GetLocation fixed on the top of the beam, highly dependent on the operator)
(more relevant solution from you, independent of the operator, another approach, that’s all, no competition, progress is my goal :wink:)
cordially
christian.stan

1 Like

No worries. The more options we give, the better.

1 Like