Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Last active August 1, 2021 12:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/30c70b529abc629cdece9620cb4d7d96 to your computer and use it in GitHub Desktop.
Save chuongmep/30c70b529abc629cdece9620cb4d7d96 to your computer and use it in GitHub Desktop.
Get Top Face Revit API
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