i tried facing orientation but the values chang if the element is rotated
Get the z component of the facing orientation, abs its value, hen set a threshold for what you count as vertical, e.g. if its 0.5 or more vertical, if its less than 0.5 horizontal.
Ignore the X and Y components of the vector and, look at just the Z component. Vector.Z is the need you’re missing.
- Element.Geometry
- If it shows solids, expload it to recieve surfaces.
- Get the surface area, filter the surface with biggest area per each element
- Get the normal of biggest surface
- Vector. AngleWithVector, use Normal vector and Vector.ZAxis
- Sort or group elements by key
Probably it could be done even simplier, but for now it should work.
ye i like that
this would work on 99% of cases but would probably take too much time with 2000+ elements
Another option.
- Add model line in family, which will be simulating element normal.
- In dynamo collect such a line per each family instance and get it’s direction.
- Do the same Vector.AngleWithVector
The absolute value of the two Z values exceeds 0.4 so they would both be vertical.
Alternatively you can take the length of only the X and Y components (Math.SquareRoot(v.X * v.X + v.Y*v.Y)) and compare that to the length of the vertical component (if the vertical exceeds the horizontal it is vertically oriented), but 99/100 times exceeding 0.4 is sufficient.
If Math.Abs(v.Z)%1 >0 then it is on some angle.



