Last active
August 1, 2021 12:13
-
-
Save chuongmep/30c70b529abc629cdece9620cb4d7d96 to your computer and use it in GitHub Desktop.
Get Top Face Revit API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static PlanarFace GetTopFace(Solid solid) | |
{ | |
PlanarFace topFace = null; | |
FaceArray faces = solid.Faces; | |
foreach (Face f in faces) | |
{ | |
PlanarFace pf = f as PlanarFace; | |
if (pf.FaceNormal.IsAlmostEqualTo(new XYZ(0, 0, 1))) | |
{ | |
topFace = pf; | |
} | |
} | |
return topFace; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment