From 72616a120845aa5e8f670b3aa462c9bf6bbdd63c Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Fri, 1 Sep 2023 12:59:59 +0100 Subject: [PATCH] Add optional panel type inputs to SetRoofPanels method as part of #2795 --- Environment_Engine/Modify/SetRoofPanels.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Environment_Engine/Modify/SetRoofPanels.cs b/Environment_Engine/Modify/SetRoofPanels.cs index ae19d78e4..9e2c853e1 100644 --- a/Environment_Engine/Modify/SetRoofPanels.cs +++ b/Environment_Engine/Modify/SetRoofPanels.cs @@ -42,8 +42,12 @@ public static partial class Modify [Description("Modifies a collection of Panels and sets their type to be roof or ceiling if they are the highest panel in the space. If the panel has one connected space then it is deemed to be a roof panel, otherwise it is a ceiling panel")] [Input("panelsAsSpace", "A collection of Environment Panels that represent a closed space")] + [Input("roofType", "The panel type to define external roof panels. Defaults to 'roof'.")] + [Input("ceilingType", "The panel type to define internal ceiling panels, defined as panels on the horizontal tilt with 2 connected spaces. Defaults to 'ceiling'.")] + [Input("internalFloorType", "The panel type to define internal floors. Defaults to 'FloorInternal'.")] [Output("panelsAsSpace", "BHoM Environment panels representing a closed space where the roof or ceiling panels have had their type set")] - public static List SetRoofPanels(this List panelsAsSpace) + [PreviousVersion("6.3", "BH.Engine.Environment.Modify.SetRoofPanels(System.Collections.Generic.List)")] + public static List SetRoofPanels(this List panelsAsSpace, PanelType roofType = PanelType.Roof, PanelType ceilingType = PanelType.Ceiling, PanelType internalFloorType = PanelType.FloorInternal) { List clones = new List(panelsAsSpace.Select(x => x.DeepClone()).ToList()); @@ -64,15 +68,15 @@ public static List SetRoofPanels(this List panelsAsSpace) foreach (Panel panel in roofPanels) { if (panel.ConnectedSpaces.Where(x => x != "-1").ToList().Count == 1) - panel.Type = PanelType.Roof; + panel.Type = roofType; else if (panel.ConnectedSpaces.Where(x => x != "-1").ToList().Count == 2) - panel.Type = PanelType.Ceiling; + panel.Type = ceilingType; } foreach (Panel panel in roofPanels) { if (panel.Type == PanelType.Ceiling && panel.MaximumLevel() != maxZ) - panel.Type = PanelType.FloorInternal; + panel.Type = internalFloorType; } return clones;