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

Calls to new PlanarSurface(ICurve, null) replaced with BH.Engine.Geometry.Create.PlanarSurface #1346

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static oM.Architecture.Elements.Ceiling CeilingFromRevit(this Ceiling cei
List<ISurface> locations = new List<ISurface>();
foreach (KeyValuePair<PlanarSurface, List<PlanarSurface>> kvp in surfaces)
{
locations.Add(new PlanarSurface(kvp.Key.ExternalBoundary, kvp.Value.Select(x => x.ExternalBoundary).ToList()));
locations.Add(BH.Engine.Geometry.Create.PlanarSurface(kvp.Key.ExternalBoundary, kvp.Value.Select(x => x.ExternalBoundary).ToList()));
}

if (locations.Count == 1)
Expand Down
2 changes: 1 addition & 1 deletion Revit_Core_Engine/Convert/Geometry/FromRevit/Surface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static oM.Geometry.PlanarSurface FromRevit(this PlanarFace face)
oM.Geometry.ICurve externalBoundary = crvLoop[0].FromRevit();
List<oM.Geometry.ICurve> internalBoundary = crvLoop.Skip(1).Select(x => x.FromRevit() as oM.Geometry.ICurve).ToList();

return new oM.Geometry.PlanarSurface(externalBoundary, internalBoundary);
return BH.Engine.Geometry.Create.PlanarSurface(externalBoundary, internalBoundary);
}


Expand Down
4 changes: 2 additions & 2 deletions Revit_Core_Engine/Query/OpeningSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private static List<ISurface> OpeningSurfaces_LinkDocument(this FamilyInstance f
pc.Curves.Add(new BH.oM.Geometry.Line { Start = pc.EndPoint(), End = pc.StartPoint() });
}

return new List<ISurface>(outlines.Select(x => new PlanarSurface(x, new List<ICurve>())));
return new List<ISurface>(outlines.Select(x => BH.Engine.Geometry.Create.PlanarSurface(x, new List<ICurve>())));
}
else
return familyInstance.OpeningSurfaces_Curtain();
Expand Down Expand Up @@ -310,7 +310,7 @@ private static List<ISurface> GetOpeningGeometry(Transaction t, Document doc, Li
t.RollBack(failureHandlingOptions);

if (loops != null)
surfaces.AddRange(loops.Select(x => new PlanarSurface(x.FromRevit(), null)));
surfaces.AddRange(loops.Select(x => BH.Engine.Geometry.Create.PlanarSurface(x.FromRevit(), null)));
else if (surfaces.Count != 0)
BH.Engine.Base.Compute.RecordWarning(String.Format("Geometrical processing of a Revit element failed due to an internal Revit error. Converted opening might be missing one or more of its surfaces. Revit ElementId: {0}", familyInstance.Id));

Expand Down
8 changes: 4 additions & 4 deletions Revit_Core_Engine/Query/PanelSurfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,11 @@ private static Dictionary<ElementId, Dictionary<PlanarSurface, List<PlanarSurfac
}

CurveLoop outline = loops.FirstOrDefault(x => x.IsCounterclockwise(plane.Normal));
PlanarSurface surface = new PlanarSurface(outline.FromRevit(), null);
PlanarSurface surface = BH.Engine.Geometry.Create.PlanarSurface(outline.FromRevit(), null);
List<PlanarSurface> openings = new List<PlanarSurface>();
foreach (CurveLoop loop in loops.Where(x => x != outline))
{
openings.Add(new PlanarSurface(loop.FromRevit(), null));
openings.Add(BH.Engine.Geometry.Create.PlanarSurface(loop.FromRevit(), null));
}

if (insertsDeleted[id])
Expand All @@ -319,7 +319,7 @@ private static Dictionary<ElementId, Dictionary<PlanarSurface, List<PlanarSurfac
{
foreach (CurveLoop cl in pf.GetEdgesAsCurveLoops())
{
openings.Add(new PlanarSurface(cl.FromRevit(), null));
openings.Add(BH.Engine.Geometry.Create.PlanarSurface(cl.FromRevit(), null));
}
}
}
Expand Down Expand Up @@ -418,7 +418,7 @@ private static Dictionary<PlanarSurface, List<PlanarSurface>> PanelSurfaces_Link
}

if (outline != null)
result.Add(new PlanarSurface(outline, new List<ICurve>()), openings.Select(x => new PlanarSurface(x, new List<ICurve>())).ToList());
result.Add(BH.Engine.Geometry.Create.PlanarSurface(outline, new List<ICurve>()), openings.Select(x => BH.Engine.Geometry.Create.PlanarSurface(x, new List<ICurve>())).ToList());
}

return result;
Expand Down