From c789456287303c254766c4d6bb44a9d85358a5be Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Mon, 11 Sep 2023 17:08:59 +0100 Subject: [PATCH] Update AssignSpaceTypeByPoint to provide extra output --- .../Compute/AssignSpaceTypeByPoint.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Environment_Engine/Compute/AssignSpaceTypeByPoint.cs b/Environment_Engine/Compute/AssignSpaceTypeByPoint.cs index 7ecf71791..236184233 100644 --- a/Environment_Engine/Compute/AssignSpaceTypeByPoint.cs +++ b/Environment_Engine/Compute/AssignSpaceTypeByPoint.cs @@ -32,6 +32,7 @@ using BH.Engine.Base; using BH.oM.Base.Attributes; using BH.oM.Environment.Elements; +using BH.oM.Base; namespace BH.Engine.Environment { @@ -45,9 +46,10 @@ public static partial class Compute [Input("spaces", "A collection of Environment Spaces to set the type for.")] [Input("searchPoints", "A collection of points to search. The points should be contained by the space geometry.")] [Input("spaceType", "The space type to assign.")] - [Output("spaces", "A collection of modified Environment Spaces with assigned space types.")] + [MultiOutput(0, "spaces", "A collection of modified Environment Spaces with assigned space types.")] + [MultiOutput(1, "spacesNotAssigned", "Spaces which were not assigned the space type because they did not contain any of the search points.")] [PreviousVersion("6.3", "BH.Engine.Environment.Compute.AssignSpaceTypeByPoint(System.Collections.Generic.List, System.Collections.Generic.List, System.String, System.Boolean)")] - public static List AssignSpaceTypeByPoint(this List spaces, List searchPoints, SpaceType spaceType) + public static Output, List> AssignSpaceTypeByPoint(this List spaces, List searchPoints, SpaceType spaceType) { List returnSpaces = new List(); for (int x = 0; x < searchPoints.Count; x++) @@ -59,7 +61,14 @@ public static List AssignSpaceTypeByPoint(this List spaces, List

spacesNotModified = spaces.Where(x => !returnSpaces.Contains(x)).ToList(); + + return new Output, List>() + { + Item1 = returnSpaces, + Item2 = spacesNotModified, + }; } } }