Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Dec 29, 2024
1 parent 4707b4b commit 8f65839
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions nodes/3.x/DisplayUnit.ToInternalUnit.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -210,8 +210,8 @@
}
],
"Annotations": [],
"X": 174.61303281699642,
"Y": 140.03743212523923,
"Zoom": 0.565293988808902
"X": 10.510265662581503,
"Y": 65.307679446397628,
"Zoom": 0.88878922829715568
}
}
2 changes: 1 addition & 1 deletion nodes/3.x/python/DisplayUnit.ToInternalUnit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8f65839

Please sign in to comment.