Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Oct 12, 2024
1 parent 58c6f76 commit 4af6cc9
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 138 deletions.
20 changes: 11 additions & 9 deletions nodes/3.x/Dimension.AssociatedFamilyParameter.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{
"Id": "33395ec782364db4af5f8b1ed0f4665e",
"Name": "",
"Description": "Value of expression at line 1",
"Description": "Wert des Ausdrucks in Zeile 1",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
Expand All @@ -39,20 +39,21 @@
{
"Id": "b551a60bd01d4004a0661b421a93dc0c",
"Name": "",
"Description": "Value of expression at line 2",
"Description": "Wert des Ausdrucks in Zeile 2",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Replication": "Disabled",
"Description": "Allows for DesignScript code to be authored directly"
"Description": "Ermöglicht die direkte Erstellung von DesignScript-Code."
},
{
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\nclr.AddReference(\"RevitNodes\")\r\nimport Revit\r\nclr.ImportExtensions(Revit.Elements)\r\n\r\ndef GetAssociatedFamilyParameters(dimension):\r\n\tif hasattr(dimension, \"FamilyLabel\"):\r\n\t\tif dimension.FamilyLabel != None: return dimension.FamilyLabel, dimension.FamilyLabel.Definition.Name\r\n\t\telse: return None, None\r\n\telse: return None, None\r\n\r\ndimensions = UnwrapElement(IN[0])\r\n\r\nif isinstance(IN[0], list): OUT = map(list, zip(*[GetAssociatedFamilyParameters(x) for x in dimensions]))\r\nelse: OUT = GetAssociatedFamilyParameters(dimensions)",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "ad4bb26e53c544f3807020d0fc0fd875",
"Inputs": [
Expand All @@ -78,7 +79,7 @@
}
],
"Replication": "Disabled",
"Description": "Runs an embedded IronPython script."
"Description": "Führt ein eingebettetes Python-Skript aus."
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore",
Expand All @@ -104,7 +105,7 @@
}
],
"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": "Ein Funktionsparameter zur Verwendung mit benutzerdefinierten Blöcken.\r\n\r\nSie können den Typ und den Vorgabewert für den Parameter angeben, z. B.\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore",
Expand All @@ -125,7 +126,7 @@
],
"Outputs": [],
"Replication": "Disabled",
"Description": "A function output, use with custom nodes"
"Description": "Eine Funktionsausgabe zur Verwendung mit benutzerdefinierten Blöcken"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore",
Expand All @@ -146,7 +147,7 @@
],
"Outputs": [],
"Replication": "Disabled",
"Description": "A function output, use with custom nodes"
"Description": "Eine Funktionsausgabe zur Verwendung mit benutzerdefinierten Blöcken"
}
],
"Connectors": [
Expand All @@ -173,18 +174,19 @@
],
"Dependencies": [],
"NodeLibraryDependencies": [],
"Author": "None provided",
"Bindings": [],
"View": {
"Dynamo": {
"ScaleFactor": 1.0,
"HasRunWithoutCrash": false,
"IsVisibleInDynamoLibrary": true,
"Version": "2.6.1.8786",
"Version": "2.12.1.8246",
"RunType": "Manual",
"RunPeriod": "1000"
},
"Camera": {
"Name": "Background Preview",
"Name": "Hintergrundvorschau",
"EyeX": -17.0,
"EyeY": 24.0,
"EyeZ": 50.0,
Expand Down
2 changes: 1 addition & 1 deletion nodes/3.x/Dimension.ReferencedElements.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\nclr.AddReference(\"RevitNodes\")\r\nimport Revit\r\nclr.ImportExtensions(Revit.Elements)\r\n\r\ndef GetDimensionReferences(item):\r\n\tif hasattr(item, \"References\"):\r\n\t\trefs = []\r\n\t\tsrefs = []\r\n\t\tlinkInstances = []\r\n\t\tfor r in item.References:\r\n\t\t\tif r.LinkedElementId != ElementId.InvalidElementId: \r\n\t\t\t\tif item.Document.GetElement(r.ElementId).GetLinkDocument():\r\n\t\t\t\t\trefs.append(item.Document.GetElement(r.ElementId).GetLinkDocument().GetElement(r.LinkedElementId))\r\n\t\t\t\t\tsrefs.append(r.ConvertToStableRepresentation(item.Document.GetElement(r.ElementId).GetLinkDocument()))\r\n\t\t\t\t# if the link isn't loaded, just return the RevitLinkInstance instead of the actual element\r\n\t\t\t\telse: \r\n\t\t\t\t\trefs.append(item.Document.GetElement(r.ElementId))\r\n\t\t\t\t\tsrefs.append(r.ConvertToStableRepresentation(item.Document))\r\n\t\t\t\tlinkInstances.append(item.Document.GetElement(r.ElementId))\r\n\t\t\telse: \r\n\t\t\t\trefs.append(item.Document.GetElement(r.ElementId))\r\n\t\t\t\tsrefs.append(r.ConvertToStableRepresentation(item.Document))\r\n\t\t\t\tlinkInstances.append(None)\r\n\t\treturn refs, linkInstances, srefs\r\n\telse: return [], [], []\r\n\r\ndimensions = UnwrapElement(IN[0])\r\n\r\nif isinstance(IN[0], list): \r\n\tif len(IN[0]) > 0: OUT = list(zip(*[GetDimensionReferences(x) for x in dimensions]))\r\n\telse: OUT = [[],[],[]]\r\nelse: OUT = GetDimensionReferences(dimensions)",
"Engine": "IronPython2",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "79097b4a5ab74d4c9b96e29dabdad192",
"Inputs": [
Expand Down
Loading

0 comments on commit 4af6cc9

Please sign in to comment.