From bf9366607c28817a9671b9b68e40f2b683043bca Mon Sep 17 00:00:00 2001 From: Ivo Petrov <48355182+ivaylo-matov@users.noreply.github.com> Date: Sun, 24 Mar 2024 14:24:47 +0000 Subject: [PATCH] New nodes --- Data_GetGraphPath.dyf | 251 ++++++++++++++++ Data_ScriptUseLog.dyf | 269 +++++++++++++++--- File_GetParentDirectory.dyf | 217 ++++++++++++++ ...eByContent.dyf => Room_RenameByContent.dyf | 138 ++++----- 4 files changed, 759 insertions(+), 116 deletions(-) create mode 100644 Data_GetGraphPath.dyf create mode 100644 File_GetParentDirectory.dyf rename Room.RenameByContent.dyf => Room_RenameByContent.dyf (97%) diff --git a/Data_GetGraphPath.dyf b/Data_GetGraphPath.dyf new file mode 100644 index 0000000..9dc8397 --- /dev/null +++ b/Data_GetGraphPath.dyf @@ -0,0 +1,251 @@ +{ + "Uuid": "0b89e053-f2d7-43f2-a3f4-30769ef4c253", + "IsCustomNode": true, + "Category": "ACG Tools", + "Description": "Gets the parh of the active Dynamo graph", + "Name": "Data.Get Graph Path", + "ElementResolver": { + "ResolutionMap": {} + }, + "Inputs": [], + "Outputs": [], + "Nodes": [ + { + "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", + "NodeType": "PythonScriptNode", + "Code": "import clr\r\nclr.AddReference('DynamoRevitDS')\r\nimport Dynamo \r\n\r\ndynamoRevit = Dynamo.Applications.DynamoRevit()\r\ncurrentWorkspace = dynamoRevit.RevitDynamoModel.CurrentWorkspace\r\n\r\npath = currentWorkspace.FileName\r\n\r\nfullFileName = path.Split(\"\\\\\")[-1] # with extension\r\nfileName = fullFileName.Replace(\".dyn\",\"\")\r\n\r\nOUT = path, fullFileName, fileName", + "Engine": "IronPython2", + "VariableInputPorts": true, + "Id": "d625771ab8064b368f767bffe290a194", + "Inputs": [], + "Outputs": [ + { + "Id": "e962589af81544c983ff1f314f08ae8a", + "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.CustomNodes.Output, DynamoCore", + "NodeType": "OutputNode", + "ElementResolver": null, + "Symbol": "// Full path of the file\r\nfile_path", + "Id": "0c2ffd3d3c4c4943959b8352342e4e2b", + "Inputs": [ + { + "Id": "8f173561e2474b73bfef39dc4e48163e", + "Name": "", + "Description": "", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [], + "Replication": "Disabled", + "Description": "A function output, use with custom nodes" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore", + "NodeType": "CodeBlockNode", + "Code": "x[0];\nx[1];\nx[2];", + "Id": "4676c8e435c34333b80f6ac29eeb2234", + "Inputs": [ + { + "Id": "fb801295d1194ee787eefee4d4c694bd", + "Name": "x", + "Description": "x", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "efe66951f7b541829e26ba80b596ace8", + "Name": "", + "Description": "Value of expression at line 1", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "c973725bae584199b7ae2961a6c47943", + "Name": "", + "Description": "Value of expression at line 2", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "0fa6becd8779497dbc8bd34b0e08e495", + "Name": "", + "Description": "Value of expression at line 3", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Allows for DesignScript code to be authored directly" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore", + "NodeType": "OutputNode", + "ElementResolver": null, + "Symbol": "// File name with extension\r\nfull_file_name", + "Id": "e4660ccad5164fc99a6316f045aca22b", + "Inputs": [ + { + "Id": "1adb081cdf104b25b862cb245d63125a", + "Name": "", + "Description": "", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [], + "Replication": "Disabled", + "Description": "A function output, use with custom nodes" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore", + "NodeType": "OutputNode", + "ElementResolver": null, + "Symbol": "// File name without extension\r\nfile_name", + "Id": "9c4419e4cb864a30b294c95688cf02fc", + "Inputs": [ + { + "Id": "1b7969a530554760b7dd555a285244ba", + "Name": "", + "Description": "", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [], + "Replication": "Disabled", + "Description": "A function output, use with custom nodes" + } + ], + "Connectors": [ + { + "Start": "e962589af81544c983ff1f314f08ae8a", + "End": "fb801295d1194ee787eefee4d4c694bd", + "Id": "0380c4cd11dd49f2ba31e5b9b461161d" + }, + { + "Start": "efe66951f7b541829e26ba80b596ace8", + "End": "8f173561e2474b73bfef39dc4e48163e", + "Id": "3ad98cda8f384d8788ad7feefb150435" + }, + { + "Start": "c973725bae584199b7ae2961a6c47943", + "End": "1adb081cdf104b25b862cb245d63125a", + "Id": "831214d3a5b0457ab6b3899ee53e8e51" + }, + { + "Start": "0fa6becd8779497dbc8bd34b0e08e495", + "End": "1b7969a530554760b7dd555a285244ba", + "Id": "0212dcb34e564bd3810cbdfc2722e5d7" + } + ], + "Dependencies": [], + "NodeLibraryDependencies": [], + "Author": "None provided", + "Bindings": [], + "View": { + "Dynamo": { + "ScaleFactor": 1.0, + "HasRunWithoutCrash": false, + "IsVisibleInDynamoLibrary": true, + "Version": "2.12.1.8246", + "RunType": "Manual", + "RunPeriod": "1000" + }, + "Camera": { + "Name": "Background Preview", + "EyeX": -17.0, + "EyeY": 24.0, + "EyeZ": 50.0, + "LookX": 12.0, + "LookY": -13.0, + "LookZ": -58.0, + "UpX": 0.0, + "UpY": 1.0, + "UpZ": 0.0 + }, + "NodeViews": [ + { + "ShowGeometry": true, + "Name": "Python Script", + "Id": "d625771ab8064b368f767bffe290a194", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 549.748430538844, + "Y": 273.19375144720306 + }, + { + "ShowGeometry": true, + "Name": "Output", + "Id": "0c2ffd3d3c4c4943959b8352342e4e2b", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 873.68912545471915, + "Y": 237.18018718299777 + }, + { + "ShowGeometry": true, + "Name": "Code Block", + "Id": "4676c8e435c34333b80f6ac29eeb2234", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 677.0, + "Y": 276.84313251905479 + }, + { + "ShowGeometry": true, + "Name": "Output", + "Id": "e4660ccad5164fc99a6316f045aca22b", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 872.56506066215377, + "Y": 308.99342348866094 + }, + { + "ShowGeometry": true, + "Name": "Output", + "Id": "9c4419e4cb864a30b294c95688cf02fc", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 883.394782668599, + "Y": 386.01782706246843 + } + ], + "Annotations": [], + "X": -482.4492768839807, + "Y": -185.19904812619058, + "Zoom": 1.4848619772588221 + } +} \ No newline at end of file diff --git a/Data_ScriptUseLog.dyf b/Data_ScriptUseLog.dyf index dfe7241..1525f4a 100644 --- a/Data_ScriptUseLog.dyf +++ b/Data_ScriptUseLog.dyf @@ -2,7 +2,7 @@ "Uuid": "aef287f9-369d-4d31-92af-a18f6962a3d3", "IsCustomNode": true, "Category": "ACG Tools", - "Description": "Adds an entry to TXT document every time a script is run. The document is located in R:\\Dynamo\\05-UsageStats", + "Description": "Adds an entry to TXT document every time a script is run.", "Name": "Data.Script Use Log", "ElementResolver": { "ResolutionMap": { @@ -24,22 +24,97 @@ "Outputs": [], "Nodes": [ { - "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore", - "NodeType": "InputNode", - "Parameter": { - "Name": "script_name", - "TypeName": "string", - "TypeRank": 0, - "DefaultValue": "null", - "Description": "The name of the script that is run." - }, - "Id": "d736b680158942c5ab7e8873cdf27792", + "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", + "NodeType": "PythonScriptNode", + "Code": "import clr\r\nclr.AddReference(\"RevitServices\")\r\nimport RevitServices\r\nfrom RevitServices.Persistence import DocumentManager\r\nfrom RevitServices.Transactions import TransactionManager\r\nclr.AddReference(\"RevitAPI\")\r\nimport Autodesk\r\nfrom Autodesk.Revit.DB import *\r\nimport System\r\nimport sys\r\nsys.path.append(r\"C:\\Program Files (x86)\\IronPython 2.7\\Lib\")\r\nimport os\r\nimport shutil\r\nfrom datetime import datetime\r\nfrom System import Environment\r\n\r\n\r\napp = DocumentManager.Instance.CurrentUIApplication.Application\r\ndoc = DocumentManager.Instance.CurrentDBDocument\r\n\r\ngraphName = \t\tIN[0]\r\ndynamoFolderPath = \tIN[1]\r\n\r\nuser = app.Username\r\n\r\n# get the project number\r\npi = FilteredElementCollector(doc)\\\r\n.OfCategory(BuiltInCategory.OST_ProjectInformation)\\\r\n.FirstElement()\r\n\r\nprjNumb = pi.LookupParameter('Project Number').AsString()\r\n# get day\r\nday = str(datetime.now().strftime('%d.%m.%y'))\r\n# get hour\r\nhour = str(datetime.now().strftime('%H:%M'))\r\n\r\n# ASSEMBLE THE DATA\r\nrawData = [graphName, user, prjNumb, day, hour]\r\ndata = ','.join(rawData) + '\\n'\r\n\r\n# get the name of the TXT file\r\nfileDate = str(datetime.now().strftime('%y%m'))\r\nfileName = fileDate + '-ACG-DynamoScriptUsage.txt'\r\n#get the path of the stats folder\r\nstatFilePath = dynamoFolderPath + \"\\\\05-UsageStats\\\\\" + fileName\r\n\r\n# WRITE THE DATA\r\nfile = open(statFilePath,'a')\r\nfile.write(data)\r\nfile.close()\r\n \r\nOUT = \"Success! Run logged!\"", + "Engine": "IronPython2", + "VariableInputPorts": true, + "Id": "c21c199a2bff4f1eb934fe052c8c633e", + "Inputs": [ + { + "Id": "7b862f5c3f714cc0abfdeff48e2a0382", + "Name": "IN[0]", + "Description": "Input #0", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "2c4915fd62284ce192e30c8b300ca7da", + "Name": "IN[1]", + "Description": "Input #1", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "ad30ef3431c64666b5e51a454815174a", + "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.CustomNodes.Function, DynamoCore", + "FunctionSignature": "eb64d5c5-8550-4cb6-99c7-eb7a8558ba8d", + "FunctionType": "Graph", + "NodeType": "FunctionNode", + "Id": "a32385da593c48269fe477a0b7c05075", + "Inputs": [ + { + "Id": "bb959f8d6f2241369de3e0a299eb3d82", + "Name": "path", + "Description": " File or folder path\n\nstring\nDefault value : null", + "UsingDefaultValue": true, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "a63fa96c668145a7be006a86d98fea20", + "Name": "index_up", + "Description": " Number of levels up\n 0 = parent folder\n 1 = 1 level up from the parent folder etc.\n\nint\nDefault value : 0", + "UsingDefaultValue": true, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "e141f9472f924d1aae6e616ee2e7b3d6", + "Name": "folder_path", + "Description": "return value", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Auto", + "Description": "" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore", + "NodeType": "CodeBlockNode", + "Code": "4;", + "Id": "b2b0965aa7bb4699994a3cb8bab29ff1", "Inputs": [], "Outputs": [ { - "Id": "9138508218844041a6e2ae213cde912c", + "Id": "81ee87b9f9774d049be8174f6e9b9f4d", "Name": "", - "Description": "Symbol", + "Description": "Value of expression at line 1", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, @@ -47,32 +122,72 @@ } ], "Replication": "Disabled", - "Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false" + "Description": "Allows for DesignScript code to be authored directly" }, { - "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", - "NodeType": "PythonScriptNode", - "Code": "import clr\r\nclr.AddReference(\"RevitServices\")\r\nimport RevitServices\r\nfrom RevitServices.Persistence import DocumentManager\r\nfrom RevitServices.Transactions import TransactionManager\r\nclr.AddReference(\"RevitAPI\")\r\nimport Autodesk\r\nfrom Autodesk.Revit.DB import *\r\nimport System\r\nimport sys\r\nsys.path.append(r\"C:\\Program Files (x86)\\IronPython 2.7\\Lib\")\r\nimport os\r\nimport shutil\r\nfrom datetime import datetime\r\nfrom System import Environment\r\n\r\n\r\napp = DocumentManager.Instance.CurrentUIApplication.Application\r\ndoc = DocumentManager.Instance.CurrentDBDocument\r\n\r\n\r\n# get the script name\r\nscriptName = str(IN[0])\r\n# get the Revit userame\r\nuser = app.Username\r\n\r\n# get the project number\r\npi = FilteredElementCollector(doc)\\\r\n.OfCategory(BuiltInCategory.OST_ProjectInformation)\\\r\n.FirstElement()\r\n\r\nprjNumb = pi.LookupParameter('Project Number').AsString()\r\n# get day\r\nday = str(datetime.now().strftime('%d.%m.%y'))\r\n# get hour\r\nhour = str(datetime.now().strftime('%H:%M'))\r\n\r\n# ASSEMBLE THE DATA\r\nrawData = [scriptName, user, prjNumb, day, hour]\r\ndata = ','.join(rawData) + '\\n'\r\n\r\n# GET THE PATHS\r\nfileDate = str(datetime.now().strftime('%y%m'))\r\nfileName = fileDate + '-ACG-DynamoScriptUsage.txt'\r\nfolderPath = 'R:\\\\3600_IT\\\\3605_BIM\\\\3605_17_Dynamo\\\\05-UsageStats\\\\' + fileName\r\n\r\n# WRITE THE DATA\r\nfile = open(folderPath,'a')\r\nfile.write(data)\r\nfile.close()", - "Engine": "IronPython2", - "EngineName": "IronPython2", - "VariableInputPorts": true, - "Id": "71868a6310d14bc6b77c192a9207d8fa", + "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore", + "NodeType": "OutputNode", + "ElementResolver": null, + "Symbol": "result", + "Id": "781548d8317f4c38adf66a1b2aef42c1", "Inputs": [ { - "Id": "8d06668798154e739d30c2bc26fcf13b", - "Name": "IN[0]", - "Description": "Input #0", + "Id": "bcae7e77123f4889b21f260e23069b3f", + "Name": "", + "Description": "", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [], + "Replication": "Disabled", + "Description": "A function output, use with custom nodes" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore", + "NodeType": "InputNode", + "Parameter": { + "Name": "graph_path", + "TypeName": "var", + "TypeRank": -1, + "DefaultValue": null, + "Description": " Graph path" + }, + "Id": "b09a829344e14d158a98be58c477aedb", + "Inputs": [], + "Outputs": [ + { + "Id": "ecca0cba934f4fd895d4fde912fc4613", + "Name": "", + "Description": "Symbol", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], + "Replication": "Disabled", + "Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore", + "NodeType": "InputNode", + "Parameter": { + "Name": "graph_name", + "TypeName": "var", + "TypeRank": -1, + "DefaultValue": null, + "Description": " Graph name" + }, + "Id": "279889197ed74205a2014038df94a3d0", + "Inputs": [], "Outputs": [ { - "Id": "f16f5d42e9b44c1ab9a13151004951a5", - "Name": "OUT", - "Description": "Result of the python script", + "Id": "e84ba39190444c728f9f40588a8c3688", + "Name": "", + "Description": "Symbol", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, @@ -80,18 +195,39 @@ } ], "Replication": "Disabled", - "Description": "Runs an embedded Python script." + "Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false" } ], "Connectors": [ { - "Start": "9138508218844041a6e2ae213cde912c", - "End": "8d06668798154e739d30c2bc26fcf13b", - "Id": "ddb5bc0d03c44f8c94e25b939348ec51", - "IsHidden": "False" + "Start": "ad30ef3431c64666b5e51a454815174a", + "End": "bcae7e77123f4889b21f260e23069b3f", + "Id": "802ee432b11349e7b0731a6165f44fac" + }, + { + "Start": "e141f9472f924d1aae6e616ee2e7b3d6", + "End": "2c4915fd62284ce192e30c8b300ca7da", + "Id": "b1b070575633427f8135c16487d01ed6" + }, + { + "Start": "81ee87b9f9774d049be8174f6e9b9f4d", + "End": "a63fa96c668145a7be006a86d98fea20", + "Id": "4e63a9ff6f7d45d7894a08de2e7e41b2" + }, + { + "Start": "ecca0cba934f4fd895d4fde912fc4613", + "End": "bb959f8d6f2241369de3e0a299eb3d82", + "Id": "5cdb5ff237ed415081380024f647e978" + }, + { + "Start": "e84ba39190444c728f9f40588a8c3688", + "End": "7b862f5c3f714cc0abfdeff48e2a0382", + "Id": "cc1430bbd34846898f3997d61ad43ec9" } ], - "Dependencies": [], + "Dependencies": [ + "eb64d5c5-8550-4cb6-99c7-eb7a8558ba8d" + ], "NodeLibraryDependencies": [], "Author": "None provided", "Bindings": [], @@ -100,12 +236,12 @@ "ScaleFactor": 1.0, "HasRunWithoutCrash": false, "IsVisibleInDynamoLibrary": true, - "Version": "2.17.1.4055", + "Version": "2.12.1.8246", "RunType": "Manual", "RunPeriod": "1000" }, "Camera": { - "Name": "_Background Preview", + "Name": "Background Preview", "EyeX": -17.0, "EyeY": 24.0, "EyeZ": 50.0, @@ -116,32 +252,71 @@ "UpY": 1.0, "UpZ": 0.0 }, - "ConnectorPins": [], "NodeViews": [ { - "Name": "Input", "ShowGeometry": true, - "Id": "d736b680158942c5ab7e8873cdf27792", + "Name": "Python Script", + "Id": "c21c199a2bff4f1eb934fe052c8c633e", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, - "X": 4065.3439660386703, - "Y": 1446.3066102882819 + "X": 6155.76652564893, + "Y": 1843.08800878184 + }, + { + "ShowGeometry": true, + "Name": "FileGetParentDirectory", + "Id": "a32385da593c48269fe477a0b7c05075", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 5875.6605748127, + "Y": 1903.3827514119532 + }, + { + "ShowGeometry": true, + "Name": "Code Block", + "Id": "b2b0965aa7bb4699994a3cb8bab29ff1", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 5750.4719032168723, + "Y": 1934.8571651599307 + }, + { + "ShowGeometry": true, + "Name": "Output", + "Id": "781548d8317f4c38adf66a1b2aef42c1", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 6304.80526492534, + "Y": 1843.0166415076455 }, { - "Name": "Python Script", "ShowGeometry": true, - "Id": "71868a6310d14bc6b77c192a9207d8fa", + "Name": "Input", + "Id": "b09a829344e14d158a98be58c477aedb", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 5433.3180141892635, + "Y": 1910.2299473977375 + }, + { + "ShowGeometry": true, + "Name": "Input", + "Id": "279889197ed74205a2014038df94a3d0", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, - "X": 4499.14673672393, - "Y": 1446.5586893308594 + "X": 5432.6552625975291, + "Y": 1836.5753248923445 } ], "Annotations": [], - "X": -2747.6751490487368, - "Y": -888.74075897514615, - "Zoom": 0.76944246597330779 + "X": -5621.0735884793221, + "Y": -1655.5189303894424, + "Zoom": 1.0475582724645389 } } \ No newline at end of file diff --git a/File_GetParentDirectory.dyf b/File_GetParentDirectory.dyf new file mode 100644 index 0000000..1ee669a --- /dev/null +++ b/File_GetParentDirectory.dyf @@ -0,0 +1,217 @@ +{ + "Uuid": "eb64d5c5-8550-4cb6-99c7-eb7a8558ba8d", + "IsCustomNode": true, + "Category": "ACG Tools", + "Description": "Returns the parent folder of a given file or folder", + "Name": "File.Get Parent Directory", + "ElementResolver": { + "ResolutionMap": {} + }, + "Inputs": [], + "Outputs": [], + "Nodes": [ + { + "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", + "NodeType": "PythonScriptNode", + "Code": "import clr\r\nimport os\r\n\r\npath = IN[0]\r\nindexUp = IN[1]\r\n\r\n# get the individual folders\r\nfolders = path.Split(\"\\\\\")\r\nnewFolders = folders[:(-indexUp - 1)]\r\n\r\n# assemble the new path\r\nnewPath = \"\\\\\".join(newFolders)\r\n\r\nOUT = newPath", + "Engine": "IronPython2", + "VariableInputPorts": true, + "Id": "9516aa0fe23641b3a026395619d28a48", + "Inputs": [ + { + "Id": "d15754fee94e400baa795d59926045ca", + "Name": "IN[0]", + "Description": "Input #0", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "2f4d31509bed47ac9b7c4153dc0a6a82", + "Name": "IN[1]", + "Description": "Input #1", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "74b6cdfd84a2402fbeffb92e3019afda", + "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.CustomNodes.Symbol, DynamoCore", + "NodeType": "InputNode", + "Parameter": { + "Name": "path", + "TypeName": "string", + "TypeRank": 0, + "DefaultValue": "null", + "Description": " File or folder path" + }, + "Id": "f18a044c3d3d44109e0ee5aced382fae", + "Inputs": [], + "Outputs": [ + { + "Id": "d69d38e7d1a6428990376196df74ca20", + "Name": "", + "Description": "Symbol", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore", + "NodeType": "InputNode", + "Parameter": { + "Name": "index_up", + "TypeName": "int", + "TypeRank": 0, + "DefaultValue": "0", + "Description": " Number of levels up\n 0 = parent folder\n 1 = 1 level up from the parent folder etc." + }, + "Id": "039f11e7852640ee9f29d835f44f871e", + "Inputs": [], + "Outputs": [ + { + "Id": "a7f0af12cc704c878130f3dbcd5da97e", + "Name": "", + "Description": "Symbol", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore", + "NodeType": "OutputNode", + "ElementResolver": null, + "Symbol": "folder_path", + "Id": "e67006dc7e874cb1a77ec0fd519753e1", + "Inputs": [ + { + "Id": "a0a167ff12fa4b8694fec4dbdcd9886b", + "Name": "", + "Description": "", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [], + "Replication": "Disabled", + "Description": "A function output, use with custom nodes" + } + ], + "Connectors": [ + { + "Start": "74b6cdfd84a2402fbeffb92e3019afda", + "End": "a0a167ff12fa4b8694fec4dbdcd9886b", + "Id": "8e7ef655dc5d4d8aa8265a31898d1d5c" + }, + { + "Start": "d69d38e7d1a6428990376196df74ca20", + "End": "d15754fee94e400baa795d59926045ca", + "Id": "49238c8b942c4ced80d09bdbede05fc5" + }, + { + "Start": "a7f0af12cc704c878130f3dbcd5da97e", + "End": "2f4d31509bed47ac9b7c4153dc0a6a82", + "Id": "a5904a61561b4057baee3660e8fb7184" + } + ], + "Dependencies": [], + "NodeLibraryDependencies": [], + "Author": "None provided", + "Bindings": [], + "View": { + "Dynamo": { + "ScaleFactor": 1.0, + "HasRunWithoutCrash": false, + "IsVisibleInDynamoLibrary": true, + "Version": "2.12.1.8246", + "RunType": "Manual", + "RunPeriod": "1000" + }, + "Camera": { + "Name": "Background Preview", + "EyeX": -17.0, + "EyeY": 24.0, + "EyeZ": 50.0, + "LookX": 12.0, + "LookY": -13.0, + "LookZ": -58.0, + "UpX": 0.0, + "UpY": 1.0, + "UpZ": 0.0 + }, + "NodeViews": [ + { + "ShowGeometry": true, + "Name": "Python Script", + "Id": "9516aa0fe23641b3a026395619d28a48", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 653.0, + "Y": 347.0 + }, + { + "ShowGeometry": true, + "Name": "Input", + "Id": "f18a044c3d3d44109e0ee5aced382fae", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 382.43133784867911, + "Y": 326.177009660613 + }, + { + "ShowGeometry": true, + "Name": "Input", + "Id": "039f11e7852640ee9f29d835f44f871e", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 199.41769438726186, + "Y": 413.26446776959978 + }, + { + "ShowGeometry": true, + "Name": "Output", + "Id": "e67006dc7e874cb1a77ec0fd519753e1", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "X": 803.71179659904567, + "Y": 345.77609252211704 + } + ], + "Annotations": [], + "X": -151.55915887779679, + "Y": -153.21455639918736, + "Zoom": 1.3775833525586676 + } +} \ No newline at end of file diff --git a/Room.RenameByContent.dyf b/Room_RenameByContent.dyf similarity index 97% rename from Room.RenameByContent.dyf rename to Room_RenameByContent.dyf index 6952801..1a0585b 100644 --- a/Room.RenameByContent.dyf +++ b/Room_RenameByContent.dyf @@ -1,70 +1,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file