Select bottom face of Slab - choose last list item

Hi I am attempting to use Dynamo to select the bottom face of a slab. Ideally I would select the slab and use a Dynamo node graph to choose the bottom face of said slab. (I wanted to do this instead of selecting the slab face itself, because there is less room for user error when used in Dynamo Player)

Please tell me if there is an easier way to do this.
I have selected the surface and exploded the geometry into a list. I attempted to grab the last list item using a List.Slice node. Is there a better way to choose the last item on a list?

If you look below, this method of selecting the surface is not working with the rest of my script. For some reason it is producing Empty Lists. Compare it to the following image in which I selected the bottom face of slab manually. In the second case the script works as desired and does not produce empty lists.

Working script below. Slab face is selected manually and Surface. PrjectionOnto produces a list with x,y,z coordinates.

Try getting the normal at parameter 0.5,0.5, and finding the value closest to 0,0,-1 (negative on the Z axis).

3 Likes

Can you explain how the normals would lead to me automatically choosing the bottom face of the slab? Additionally did you recommend the parameter 0.5,0.5?

A face’s normal is the direction which you’d be looking if you were to lay down on the surface.
The simplest state for a floor consists of a top face, a bottom face, and some edge faces.
The normal of the top face will always point up (ish) and have a vector of about (0,0,1), while the normal of the bottom face will always point down(ish) and be about (0,0,-1), and the normal for edges will always point sideways(ish) and have a vector around (X,Y,0).

By looking for -1 on the Z you get the right face by default for the simple state slab.

As geometry gets more complex you may find you get more surfaces than just your desired face, but that specific geometry condition is unknown in this thread so we have to plan off the simple state.

Thanks Jacob. I understand the overall concept now. The normal direction allows Revit to understand if the plane is pointed up or down. I was trying to find a Dynamo node to determine the normals of this floor. But all of the Dynamo nodes about normals seem to be based on smaller elements like surfaces or points. Do I need to first ‘explode’ the floor into 4 sub surfaces before I find the normals?

Exploding the solid is one method. Another would be the use of the Element.Faces node.

Hi thanks for your help. I am having some trouble selecting the correct side as a surface. In this example I tried finding the normals for the floor. I found the normals in the Z direction. But this floor is not flat and is slopped.
So the normal wouldn’t be exactly -1. I worked out the conditions that the normals would be between 0 and -1, but I do not know how to apply those conditions.

Is there a way to build an if then statement that goes something like this… If the normals are <0 and greater than or equal to -1, then select that surface.

Is there a simpler way of doing this? I’m new to Dynamo and coding in general.