I am trying to get the surface areas of generic models. I need to send this area back to the corresponding element’s parameter. What would be the easy way to do that?
I am not using element.geometry or element.solid or element.faces nodes because:
- There are some unavoidable warnings (trim_with_edge_loops requires all curves to touch surface).
- I only want the areas of lateral faces. (no base or top)
what you mean lateral? can mark the samples in the images?
Maybe this clockwork node is useful? You can dig around inside and reuse the nodes…
I considered using this, but the surfaces aren’t flat.
No, but you can filter out those which are flat?
Apologies if it isn’t useful…
Hey, no worries. Thanks for the suggestion though.
Manually selecting faces works absolutely fine for me, but I can’t match them with the Revit element/object.
I prefer manual selecting here because it’s not able to handle all the element’s geometry due to the warnings.
Hmm… I would have thought you could define the filter such that it will choose the right ones…
But I guess there is always a chance that some will fall through the net…
Let us know how you get on
Edit: I’m pretty curious to know what this is for, it looks cool!
Maybe you can try this approach
The red line pierces the element AND the surface
Good approach. But there are some small faces around the edge. I have more of such objects with different sizes in the file.
An approach with a filtering of surfaces with a dot product with Z vector
from Autodesk.DesignScript.Geometry import *
#import Revit API
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
from Autodesk.Revit.UI.Selection import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
outFaces = 
TaskDialog.Show("selection", "Select Faces")
refs = uidoc.Selection.PickObjects(ObjectType.Face, "select face")
for ref in refs:
elem = doc.GetElement(ref)
face = elem.GetGeometryObjectFromReference(ref)
bbxUv = face.GetBoundingBox()
centerUv = (bbxUv.Max + bbxUv.Min) / 2
normal = face.ComputeNormal(centerUv)
normal = normal.Normalize()
if abs(normal.DotProduct(XYZ.BasisZ)) < 0.5:
surfaceDs = face.ToProtoType()
outFaces.append([elem, surfaceDs, surfaceDs.Area])
OUT = outFaces