Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings about nonplanar faces added when querying panel surfaces #1384

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Revit_Core_Engine/Query/PanelPlanes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ public static List<Plane> PanelPlanes(this Floor floor, RevitSettings settings)
List<Plane> result = new List<Plane>();
foreach (Reference reference in HostObjectUtils.GetTopFaces(floor))
{

PlanarFace pf = floor.GetGeometryObjectFromReference(reference) as PlanarFace;
if (pf != null)
{
Plane plane = Plane.CreateByNormalAndOrigin(pf.FaceNormal, pf.Origin);
if (result.All(x => !x.IsSimilar(plane, settings, true)))
result.Add(plane);
}
else
BH.Engine.Base.Compute.RecordWarning($"Some top faces of the floor are not planar, therefore they could not be queried. ElementId: {floor.Id.IntegerValue}");
}

return result;
Expand All @@ -110,6 +111,8 @@ public static List<Plane> PanelPlanes(this RoofBase roof, RevitSettings settings
if (result.All(x => !x.IsSimilar(plane, settings, true)))
result.Add(plane);
}
else
BH.Engine.Base.Compute.RecordWarning($"Some top faces of the roof are not planar, therefore they could not be queried. ElementId: {roof.Id.IntegerValue}");
}

return result;
Expand All @@ -135,6 +138,8 @@ public static List<Plane> PanelPlanes(this Ceiling ceiling, RevitSettings settin
if (result.All(x => !x.IsSimilar(plane, settings, true)))
result.Add(plane);
}
else
BH.Engine.Base.Compute.RecordWarning($"Some top faces of the ceiling are not planar, therefore they could not be queried. ElementId: {ceiling.Id.IntegerValue}");
}

return result;
Expand Down