{ "Uuid": "2344df3c-35d0-4ee4-b20a-6a7259317cfc", "IsCustomNode": true, "Category": "infeeeee.List", "Description": "Replace same elements follow each other", "Name": "ReplaceFollowingElements", "ElementResolver": { "ResolutionMap": { "Lists": { "Key": "archilab.Lists.Lists", "Value": "archilab.dll" }, "DSCore.List": { "Key": "DSCore.List", "Value": "DSCoreNodes.dll" } } }, "Inputs": [], "Outputs": [], "Nodes": [ { "ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels", "NodeType": "PythonScriptNode", "Code": "# Enable Python support and load DesignScript library\r\nimport clr\r\nclr.AddReference('ProtoGeometry')\r\nfrom Autodesk.DesignScript.Geometry import *\r\n\r\n# The inputs to this node will be stored as a list in the IN variables.\r\nin_list = IN[0]\r\nsearchfor = IN[1]\r\nreplacement = IN[2]\r\ncountUnit = IN[3]\r\nOUT = []\r\nout_list_1 = []\r\nout_list_2 = []\r\n# Place your code below this line\r\nfor layerlists in in_list:\r\n\tlayerlist_mod = layerlists[:]\r\n\tfor num, width in enumerate(layerlists): \r\n\t#egyesével végig megyünk a vastagságokon\r\n\t\tzerocounter = []\r\n\t\tif width == searchfor :\r\n\t\t\tzerocounter.append(0)\r\n\t\t\tfor zero in layerlists[num + 1:]:\r\n\t\t\t\tif zero == searchfor:\r\n\t\t\t\t\tzerocounter.append(0)\r\n\t\t\t\telse:\r\n\t\t\t\t\tbreak\r\n\t\t\tif len(zerocounter) > 1:\r\n\t\t\t\tfor n, x in enumerate(zerocounter):\r\n\t\t\t\t\tlayerlists[num + n] = replacement\r\n\t\t\t\t\tlayerlist_mod[num + n] = replacement\r\n\t\t\t\tlayerlist_mod[num] = str(len(zerocounter)) + \" \" + countUnit\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\tout_list_1.append(layerlists)\r\n\tout_list_2.append(layerlist_mod)\r\n\r\n# Assign your output to the OUT variable.\r\nOUT.append(out_list_1)\r\nOUT.append(out_list_2)\r\n#OUT = out_list", "VariableInputPorts": true, "Id": "77e31556377b411b8eca6430ca11ea7e", "Inputs": [ { "Id": "4bd6cc7e60ef4482957ae8b6be5484b3", "Name": "IN[0]", "Description": "Input #0", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "9f76375875fb475198839c3cd96a6b93", "Name": "IN[1]", "Description": "Input #1", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "03108eab5cae462996609a385ad0cf2c", "Name": "IN[2]", "Description": "Input #2", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "e65a5e27b9aa4ede932883f54d7fe4f0", "Name": "IN[3]", "Description": "Input #3", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Outputs": [ { "Id": "2cac3dac1b12409d812c2f8647fdc1ea", "Name": "OUT", "Description": "Result of the python script", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Replication": "Disabled", "Description": "Runs an embedded IronPython script." }, { "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore", "NodeType": "InputNode", "Parameter": { "Name": "list", "TypeName": "var", "TypeRank": -1, "DefaultValue": null, "Description": "" }, "Id": "44587089b7814ac2bc79a159b1015a85", "Inputs": [], "Outputs": [ { "Id": "2bbaa41ce22d43b98b9290a009efd045", "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": "searchFor", "TypeName": "var", "TypeRank": -1, "DefaultValue": null, "Description": "" }, "Id": "8478a0485a994131bd46e950bb38ccd4", "Inputs": [], "Outputs": [ { "Id": "ba2f0d709bae428dadc660fa30c60513", "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": "replacement", "TypeName": "var", "TypeRank": -1, "DefaultValue": null, "Description": "" }, "Id": "9abef8e9b0ff466e8bc5fb914a10366f", "Inputs": [], "Outputs": [ { "Id": "7841682405354ee883639688165f4a80", "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": "replacedList", "Id": "a6e65063a91d4cadaea0b58a696701ce", "Inputs": [ { "Id": "5b34c4f690d147d590be6eb74440c4ea", "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": "countUnit", "TypeName": "var", "TypeRank": -1, "DefaultValue": null, "Description": "" }, "Id": "3455c7e5c60545aa8b031511838ff2e0", "Inputs": [], "Outputs": [ { "Id": "78217337dbaf437d9037cb56b500d0e8", "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": "firstReplacedList", "Id": "5059007ac9d845399591ff1113cffe8f", "Inputs": [ { "Id": "69ab7c827d094047826f4f64e1c82924", "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": "a[0];\na[1];", "Id": "381b76b9f59d406aaf93319c25918e79", "Inputs": [ { "Id": "79e9e4162e7349bca96ee06a3d9693fc", "Name": "a", "Description": "a", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Outputs": [ { "Id": "fcb38d32d6254873953f3aafd208001e", "Name": "", "Description": "Value of expression at line 1", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "aa7998aa8877457fa956aae658d1d4de", "Name": "", "Description": "Value of expression at line 2", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Replication": "Disabled", "Description": "Allows for DesignScript code to be authored directly" } ], "Connectors": [ { "Start": "2cac3dac1b12409d812c2f8647fdc1ea", "End": "79e9e4162e7349bca96ee06a3d9693fc", "Id": "009d04d0e39042c3ac014652655d4791" }, { "Start": "2bbaa41ce22d43b98b9290a009efd045", "End": "4bd6cc7e60ef4482957ae8b6be5484b3", "Id": "974842f317e04c20aa463b2bd86637ad" }, { "Start": "ba2f0d709bae428dadc660fa30c60513", "End": "9f76375875fb475198839c3cd96a6b93", "Id": "f367b0aae3a64af192845f03a04d5c01" }, { "Start": "7841682405354ee883639688165f4a80", "End": "03108eab5cae462996609a385ad0cf2c", "Id": "a73c7b76fca0412a94ac744c9515fb04" }, { "Start": "78217337dbaf437d9037cb56b500d0e8", "End": "e65a5e27b9aa4ede932883f54d7fe4f0", "Id": "84ffc326e46b49e483f2f6e95689069d" }, { "Start": "fcb38d32d6254873953f3aafd208001e", "End": "5b34c4f690d147d590be6eb74440c4ea", "Id": "48aab268bf724672a105904b7cac667d" }, { "Start": "aa7998aa8877457fa956aae658d1d4de", "End": "69ab7c827d094047826f4f64e1c82924", "Id": "ed81307e6e8c465988f0becc6841fb17" } ], "Dependencies": [], "Bindings": [], "View": { "Dynamo": { "ScaleFactor": 1.0, "HasRunWithoutCrash": false, "IsVisibleInDynamoLibrary": true, "Version": "2.0.2.6826", "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": "77e31556377b411b8eca6430ca11ea7e", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 731.09482951290761, "Y": 449.69653091009968 }, { "ShowGeometry": true, "Name": "Input", "Id": "44587089b7814ac2bc79a159b1015a85", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 348.5961952368678, "Y": 342.64948490670116 }, { "ShowGeometry": true, "Name": "Input", "Id": "8478a0485a994131bd46e950bb38ccd4", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 405.72490243930486, "Y": 453.9132224497277 }, { "ShowGeometry": true, "Name": "Input", "Id": "9abef8e9b0ff466e8bc5fb914a10366f", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 381.932288694968, "Y": 540.658977642674 }, { "ShowGeometry": true, "Name": "Output", "Id": "a6e65063a91d4cadaea0b58a696701ce", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 1134.1067457170113, "Y": 381.89895541340286 }, { "ShowGeometry": true, "Name": "Input", "Id": "3455c7e5c60545aa8b031511838ff2e0", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 389.17365259170657, "Y": 643.8484131711989 }, { "ShowGeometry": true, "Name": "Output", "Id": "5059007ac9d845399591ff1113cffe8f", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 1125.96021133318, "Y": 560.21754137059054 }, { "ShowGeometry": true, "Name": "Code Block", "Id": "381b76b9f59d406aaf93319c25918e79", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 905.29306876766179, "Y": 449.47392406724794 } ], "Annotations": [], "X": 5.8411916845483347, "Y": -135.64652827534235, "Zoom": 1.1047642563030273 } }