From 1817a8770dbd154695ac64be1f131ec78713dab5 Mon Sep 17 00:00:00 2001 From: infeeeee Date: Wed, 5 May 2021 02:26:57 +0200 Subject: [PATCH] Updated ConvertToMeter.dyf to Revit 2022 --- nodes/ConvertToMeter.dyf | 321 ++++++++++++++++++++++++++++++++++----- 1 file changed, 286 insertions(+), 35 deletions(-) diff --git a/nodes/ConvertToMeter.dyf b/nodes/ConvertToMeter.dyf index 843475c..fefa839 100644 --- a/nodes/ConvertToMeter.dyf +++ b/nodes/ConvertToMeter.dyf @@ -100,6 +100,7 @@ "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", "NodeType": "PythonScriptNode", "Code": "#Copyright (c) Data Shapes, 2018\n#Data-Shapes www.data-shapes.net , elayoubi.mostafa@data-shapes.io @data_shapes\n\nimport clr\nclr.AddReference('RevitAPI')\nfrom Autodesk.Revit.DB import*\nclr.AddReference('RevitServices')\nfrom RevitServices.Persistence import DocumentManager\n\ndoc = DocumentManager.Instance.CurrentDBDocument\nFOptions = Document.GetUnits(doc).GetFormatOptions(UnitType.UT_Length)\nUIunit = FOptions.DisplayUnits\nShow = UIunit.ToString().split('_')\ndel Show[0]\nShow = ' '.join([s.title() for s in Show])\n\nOUT = Show", + "Engine": "IronPython2", "VariableInputPorts": true, "Id": "dd4764e1aa794811950feebef8f6026d", "Inputs": [], @@ -115,7 +116,7 @@ } ], "Replication": "Disabled", - "Description": "Runs an embedded IronPython script." + "Description": "Runs an embedded Python script." }, { "ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore", @@ -155,6 +156,176 @@ ], "Replication": "Disabled", "Description": "Allows for DesignScript code to be authored directly" + }, + { + "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", + "NodeType": "PythonScriptNode", + "Code": "# Based on data-shapes Document.LengthDisplayUnit\n\nimport clr\nclr.AddReference('RevitAPI')\nfrom Autodesk.Revit.DB import*\nclr.AddReference('RevitServices')\nfrom RevitServices.Persistence import DocumentManager\n\ndoc = DocumentManager.Instance.CurrentDBDocument\n\n# Get current format options\nFOptions = Document.GetUnits(doc).GetFormatOptions(ForgeTypeId('autodesk.spec.aec:length'))\n\n# Get current unit\nUIunit = FOptions.GetUnitTypeId()\n\n# convert to meter\nOUT = UnitUtils.Convert(IN[0],UIunit,ForgeTypeId('autodesk.unit.unit:meters'))\n\n", + "Engine": "IronPython2", + "VariableInputPorts": true, + "Id": "8c7f766c28cc4f31a77efe93182ff7cf", + "Inputs": [ + { + "Id": "eaf1dc8b091d46dd9ca3654a5a63bf3e", + "Name": "IN[0]", + "Description": "Input #0", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "f97c6c7b31bf4602a9ff3e39d623fe36", + "Name": "OUT", + "Description": "Result of the python script", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Runs an embedded Python script." + }, + { + "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", + "NodeType": "PythonScriptNode", + "Code": "# Based on clockwork Application.Version\r\n\r\nimport clr\r\nclr.AddReference(\"RevitServices\")\r\nimport RevitServices\r\nfrom RevitServices.Persistence import DocumentManager\r\n\r\ndoc = DocumentManager.Instance.CurrentDBDocument\r\nuiapp = DocumentManager.Instance.CurrentUIApplication\r\napp = uiapp.Application\r\n\r\nOUT = int(app.VersionNumber)", + "Engine": "IronPython2", + "VariableInputPorts": true, + "Id": "5b303d3d5dba40dd98298bd5ac8c4ab9", + "Inputs": [ + { + "Id": "e82e44daf0944129a898fc5bf76171d8", + "Name": "IN[0]", + "Description": "Input #0", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "00e945dea78b42918b69d7418910f14f", + "Name": "OUT", + "Description": "Result of the python script", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Runs an embedded Python script." + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "NodeType": "FunctionNode", + "FunctionSignature": ">@var[]..[],var[]..[]", + "Id": "f80e70d061794bb685842637fd5b30d3", + "Inputs": [ + { + "Id": "dd946bd0812f48c4be9df80ee24fdf73", + "Name": "x", + "Description": "x value.\n\nvar[]..[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "516a83958791405aa64ee02425095209", + "Name": "y", + "Description": "y value.\n\nvar[]..[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "ba69df7fc8bc4be9bb81d47dd6b34000", + "Name": "var[]..[]", + "Description": "var[]..[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Auto", + "Description": "x greater y?\n\n> (x: var[]..[], y: var[]..[]): var[]..[]" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore", + "NodeType": "CodeBlockNode", + "Code": "2021;", + "Id": "5f41aec8409647088605e8fa3305c694", + "Inputs": [], + "Outputs": [ + { + "Id": "c3d3da4007a64b96a235ac2a51efcf3c", + "Name": "", + "Description": "Value of expression at line 1", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Allows for DesignScript code to be authored directly" + }, + { + "ConcreteType": "CoreNodeModels.Logic.If, CoreNodeModels", + "NodeType": "ExtensionNode", + "Id": "297f622095bd42b2aeb7df5ae66d47da", + "Inputs": [ + { + "Id": "42dd2030de304592aa1ca0ff5de736dc", + "Name": "test", + "Description": "Boolean test", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "191d19e04a2945b8a8e906fe8f5b96c8", + "Name": "true", + "Description": "Returned if test is true", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "aac390607f6544a3a0f90a702f05c891", + "Name": "false", + "Description": "Returned if test is false", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "08a03068ac054f85b28c0f74c853b57d", + "Name": "result", + "Description": "Result block produced", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Conditional statement" } ], "Connectors": [ @@ -163,6 +334,11 @@ "End": "2eeeb6df0f15483aaa15fcf8d35df6d2", "Id": "7f0d019d2293492eb47afa17d0f8319b" }, + { + "Start": "b501676612b6478dbf2e72025bb27c40", + "End": "eaf1dc8b091d46dd9ca3654a5a63bf3e", + "Id": "73bde4ae5f384e7dab082ee6a6fc9ec7" + }, { "Start": "b01f68faaa6c4d789650531ec589f7b4", "End": "d05ade86d5af42609323c66d5c67ff7f", @@ -175,8 +351,33 @@ }, { "Start": "ef4caa4485c94a94962f59e58fb152e4", + "End": "aac390607f6544a3a0f90a702f05c891", + "Id": "aa989932b8aa4ff4bb4ca50c537052de" + }, + { + "Start": "f97c6c7b31bf4602a9ff3e39d623fe36", + "End": "191d19e04a2945b8a8e906fe8f5b96c8", + "Id": "1814e66d36b94b689961c5a1d83a343d" + }, + { + "Start": "00e945dea78b42918b69d7418910f14f", + "End": "dd946bd0812f48c4be9df80ee24fdf73", + "Id": "931a03e0e70743d095b42b322288fce1" + }, + { + "Start": "ba69df7fc8bc4be9bb81d47dd6b34000", + "End": "42dd2030de304592aa1ca0ff5de736dc", + "Id": "69e44183dfe54da7a6611cdf20a718b3" + }, + { + "Start": "c3d3da4007a64b96a235ac2a51efcf3c", + "End": "516a83958791405aa64ee02425095209", + "Id": "784a648be5e647d38496c918a61fdaf6" + }, + { + "Start": "08a03068ac054f85b28c0f74c853b57d", "End": "86a6d4e81dae4118b323a5b14e5a448f", - "Id": "63fba3807fb242e8b14de64b51bc9644" + "Id": "36780095d1db40c1b5806089a1eadbeb" } ], "Dependencies": [], @@ -187,72 +388,122 @@ "ScaleFactor": 1.0, "HasRunWithoutCrash": false, "IsVisibleInDynamoLibrary": true, - "Version": "2.3.0.5885", + "Version": "2.10.1.3976", "RunType": "Manual", "RunPeriod": "1000" }, "Camera": { "Name": "Background Preview", - "EyeX": -100626.82073850936, - "EyeY": 370777.98985935876, - "EyeZ": 186476.80299970528, - "LookX": 82993.109801009356, - "LookY": -378777.98985935876, - "LookZ": -203476.31862470528, - "UpX": 0.27844678833061143, - "UpY": 0.67559020761566158, - "UpZ": -0.682675074572229 + "EyeX": 29.079783934082467, + "EyeY": 16.776168007768419, + "EyeZ": -10.906455497398817, + "LookX": -26.796219843353708, + "LookY": -12.611168045915392, + "LookZ": 4.6336312099842658, + "UpX": -0.21327446603351286, + "UpY": 0.97629600711994025, + "UpZ": 0.036879650483638178 }, "NodeViews": [ { - "ShowGeometry": true, - "Name": "Output", "Id": "254f4ae16e5d42c1bf4d9970684efbde", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "Output", + "ShowGeometry": true, "Excluded": false, - "X": 898.52380216322445, - "Y": 533.53666666666663 + "X": 1189.7121769290493, + "Y": 701.656747191841 }, { - "ShowGeometry": true, - "Name": "Input", "Id": "1cfe174d311b4f93bc294d02f4152ac2", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "Input", + "ShowGeometry": true, "Excluded": false, - "X": 228.5238021632245, - "Y": 775.53666666666663 + "X": -375.85417601564376, + "Y": 488.615752914164 }, { - "ShowGeometry": true, - "Name": "Code Block", "Id": "e5530a5429824985b5207815f0d7455a", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "Code Block", + "ShowGeometry": true, "Excluded": false, - "X": 228.5238021632245, - "Y": 278.17666666666668 + "X": 215.18714273473785, + "Y": 67.753817906097851 }, { - "ShowGeometry": true, - "Name": "Python Script", "Id": "dd4764e1aa794811950feebef8f6026d", "IsSetAsInput": true, "IsSetAsOutput": false, + "Name": "Python Script", + "ShowGeometry": true, "Excluded": false, - "X": 34.5238021632245, - "Y": 273.96333333333337 + "X": -2.2275665995848044, + "Y": 50.203825144277772 }, { - "ShowGeometry": true, - "Name": "Code Block", "Id": "415b231044aa4b718005da23768919b2", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "Code Block", + "ShowGeometry": true, "Excluded": false, "X": 715.52380216322445, "Y": 537.75 + }, + { + "Id": "8c7f766c28cc4f31a77efe93182ff7cf", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Name": "2021", + "ShowGeometry": true, + "Excluded": false, + "X": 211.83947199819158, + "Y": 673.857919747532 + }, + { + "Id": "5b303d3d5dba40dd98298bd5ac8c4ab9", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Name": "Revit version", + "ShowGeometry": true, + "Excluded": false, + "X": 214.39712586365931, + "Y": 880.50707472170416 + }, + { + "Id": "f80e70d061794bb685842637fd5b30d3", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Name": ">", + "ShowGeometry": true, + "Excluded": false, + "X": 476.905816022454, + "Y": 976.40326887909123 + }, + { + "Id": "5f41aec8409647088605e8fa3305c694", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Name": "Code Block", + "ShowGeometry": true, + "Excluded": false, + "X": 229.87003292419104, + "Y": 1044.0846960095998 + }, + { + "Id": "297f622095bd42b2aeb7df5ae66d47da", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Name": "If", + "ShowGeometry": true, + "Excluded": false, + "X": 959.1977125572173, + "Y": 709.36213969917173 } ], "Annotations": [ @@ -260,8 +511,8 @@ "Id": "552a6cdd76d0428a87a2adb9e46fdd5c", "Title": "Based on Document.LengthDisplayUnit from Data-Shapes", "Nodes": [], - "Left": -13.338278931750665, - "Top": 156.92878338278945, + "Left": -53.650478555094196, + "Top": -7.483543797364149, "Width": 0.0, "Height": 0.0, "FontSize": 36.0, @@ -271,8 +522,8 @@ "Background": "#FFC1D676" } ], - "X": 142.11249999999995, - "Y": 177.66249999999997, - "Zoom": 0.8425 + "X": 417.19679503053948, + "Y": 262.56891523614593, + "Zoom": 0.64686561309241419 } } \ No newline at end of file