From cbfdd67306a185d2079d3e577405dfc1adefb463 Mon Sep 17 00:00:00 2001 From: oguzhankoral Date: Wed, 13 Nov 2024 09:09:05 +0000 Subject: [PATCH] Fix the condition --- SpeckleAutomateDotnetExample/AutomateFunction.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/SpeckleAutomateDotnetExample/AutomateFunction.cs b/SpeckleAutomateDotnetExample/AutomateFunction.cs index 8dae43a..9661cbc 100644 --- a/SpeckleAutomateDotnetExample/AutomateFunction.cs +++ b/SpeckleAutomateDotnetExample/AutomateFunction.cs @@ -71,11 +71,23 @@ IEnumerable failedObjects foreach (var failedObject in failedObjects) { var speckleTypeString = failedObject.SpeckleType.ToString(); + string message = ""; + if (failedObject.UValue == 0) + { + message = + $"{speckleTypeString[..^1]} has no any material that have thermal properties."; + } + else + { + message = + $"{speckleTypeString[..^1]} expected to have maximum {failedObject.ExpectedUValue} U-value but it is {failedObject.UValue}."; + } + automationContext.AttachResultToObjects( ObjectResultLevel.Error, speckleTypeString, new[] { failedObject.Id }, - $"{speckleTypeString[..^1]} expected to have maximum {failedObject.ExpectedUValue} U-value but it is {failedObject.UValue}." + message ); } } @@ -171,7 +183,7 @@ SpeckleType speckleType expectedValue, speckleType )); - return objectsToCheck.Where(obj => obj.UValue < expectedValue); + return objectsToCheck.Where(obj => obj.UValue > expectedValue || obj.UValue == 0); } private static ClimateZone GetClimateZone(string climateZoneString)