From 8f658390a1e800727fa9cb50bfbb5cbbe765ced4 Mon Sep 17 00:00:00 2001 From: Andreas Dieckmann Date: Sun, 29 Dec 2024 17:45:32 +0100 Subject: [PATCH] #416 --- nodes/3.x/DisplayUnit.ToInternalUnit.dyf | 8 ++++---- nodes/3.x/python/DisplayUnit.ToInternalUnit.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nodes/3.x/DisplayUnit.ToInternalUnit.dyf b/nodes/3.x/DisplayUnit.ToInternalUnit.dyf index 0289a046..9f7cc43c 100644 --- a/nodes/3.x/DisplayUnit.ToInternalUnit.dyf +++ b/nodes/3.x/DisplayUnit.ToInternalUnit.dyf @@ -86,7 +86,7 @@ { "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", "NodeType": "PythonScriptNode", - "Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\ndef ToInternalUnits(val, unittype):\r\n\tif str(dispunit.GetType() == \"Autodesk.Revit.DB.ForgeTypeId\"):\r\n\t\treturn UnitUtils.ConvertToInternalUnits(val,unittype)\r\n\telse: return None\r\n\r\nvals = IN[0]\r\ndispunit = IN[1]\r\n\r\nif isinstance(IN[0], list): OUT = [ToInternalUnits(x, dispunit) for x in vals]\r\nelse: OUT = ToInternalUnits(vals, dispunit)", + "Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\ndef ToInternalUnits(val, unittype):\r\n\tif str(dispunit.GetType()) == \"Autodesk.Revit.DB.ForgeTypeId\":\r\n\t\treturn UnitUtils.ConvertToInternalUnits(val,unittype)\r\n\telse: return None\r\n\r\nvals = IN[0]\r\ndispunit = IN[1]\r\n\r\nif isinstance(IN[0], list): OUT = [ToInternalUnits(x, dispunit) for x in vals]\r\nelse: OUT = ToInternalUnits(vals, dispunit)", "Engine": "CPython3", "VariableInputPorts": true, "Id": "f0162f3dbe0f411494a2b3b4413bef36", @@ -210,8 +210,8 @@ } ], "Annotations": [], - "X": 174.61303281699642, - "Y": 140.03743212523923, - "Zoom": 0.565293988808902 + "X": 10.510265662581503, + "Y": 65.307679446397628, + "Zoom": 0.88878922829715568 } } \ No newline at end of file diff --git a/nodes/3.x/python/DisplayUnit.ToInternalUnit.py b/nodes/3.x/python/DisplayUnit.ToInternalUnit.py index 1d75c5b2..f40ce862 100644 --- a/nodes/3.x/python/DisplayUnit.ToInternalUnit.py +++ b/nodes/3.x/python/DisplayUnit.ToInternalUnit.py @@ -3,7 +3,7 @@ from Autodesk.Revit.DB import * def ToInternalUnits(val, unittype): - if str(dispunit.GetType() == "Autodesk.Revit.DB.ForgeTypeId"): + if str(dispunit.GetType()) == "Autodesk.Revit.DB.ForgeTypeId": return UnitUtils.ConvertToInternalUnits(val,unittype) else: return None