From 2ae272d5ccbceb35cbe82471c2e849e7593e60e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Cort=C3=A9s?= <36660222+pedrocortesark@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:22:38 +0100 Subject: [PATCH] Tolerace error in Revit when units are mm --- .../Structure/AddPhysicalElement-AnalyticalElement.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/RhinoInside.Revit.GH/Components/Structure/AddPhysicalElement-AnalyticalElement.cs b/src/RhinoInside.Revit.GH/Components/Structure/AddPhysicalElement-AnalyticalElement.cs index 28859eb5f..7751335d1 100644 --- a/src/RhinoInside.Revit.GH/Components/Structure/AddPhysicalElement-AnalyticalElement.cs +++ b/src/RhinoInside.Revit.GH/Components/Structure/AddPhysicalElement-AnalyticalElement.cs @@ -129,7 +129,10 @@ protected override void TrySolveInstance(IGH_DataAccess DA) var floorTypes = collector .OfCategory(ARDB.BuiltInCategory.OST_Floors) .WhereElementIsElementType() - .Where(t => t.get_Parameter(ARDB.BuiltInParameter.FLOOR_ATTR_DEFAULT_THICKNESS_PARAM).AsDouble() == panel.Thickness) + .Where(t => Rhino.RhinoMath.EpsilonEquals( + t.get_Parameter(ARDB.BuiltInParameter.FLOOR_ATTR_DEFAULT_THICKNESS_PARAM).AsDouble(), + panel.Thickness, + tol.DefaultTolerance)) .Select(t => t) .Cast() .ToList(); @@ -212,7 +215,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA) .WhereElementIsElementType() .Select(t => t) .Cast() - .Where(t => t.Width == analyticalPanel.Thickness) + .Where(t => Rhino.RhinoMath.EpsilonEquals(t.Width, analyticalPanel.Thickness, tol.DefaultTolerance)) .ToList(); if (wallTypes.Count == 0)