Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Sep 28, 2023
1 parent 1705a41 commit b6ef8c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodes/2.x/Element.SuperComponent.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Uuid": "27a35be1-7b94-48e9-8972-022c3767bbb9",
"IsCustomNode": true,
"Category": "Clockwork.Revit.Elements.Query",
"Description": "Retrieves the supercomponent of a given family instance, hand rail, top rail, stair component, topography subregion or beam in a beam system.",
"Description": "Retrieves the supercomponent of a given family instance, hand rail, top rail, stair component or beam in a beam system.",
"Name": "Element.SuperComponent",
"ElementResolver": {
"ResolutionMap": {}
Expand Down Expand Up @@ -60,7 +60,7 @@
{
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\ndef GetSuperComponent(item):\r\n\tif hasattr(item, \"SuperComponent\"): \r\n\t\tsc = item.SuperComponent\r\n\t\tif sc: return sc\r\n\t\telse: return BeamSystem.BeamBelongsTo(item)\r\n\tif hasattr(item, \"HostRailingId\"): return item.Document.GetElement(item.HostRailingId)\r\n\telif hasattr(item, \"GetStairs\"): return item.GetStairs()\r\n\telif hasattr(item, \"IsSiteSubRegion\"):\r\n\t\tif item.IsSiteSubRegion:\r\n\t\t\treturn item.Document.GetElement(item.AsSiteSubRegion().HostId)\r\n\t\telse: return None\r\n\telse: return None\r\n\r\nitems = UnwrapElement(IN[0])\r\n\r\nif isinstance(IN[0], list): OUT = [GetSuperComponent(x) for x in items]\r\nelse: OUT = GetSuperComponent(items)",
"Code": "import clr\r\nclr.AddReference('RevitAPI')\r\nfrom Autodesk.Revit.DB import *\r\n\r\ndef GetSuperComponent(item):\r\n\t# nested families\r\n\tif hasattr(item, \"SuperComponent\"): return item.SuperComponent\r\n\t# beam systems\r\n\tif hasattr(item, \"BeamBelongsTo\"): return BeamSystem.BeamBelongsTo(item)\r\n\t# handrails\r\n\tif hasattr(item, \"HostRailingId\"): return item.Document.GetElement(item.HostRailingId)\r\n\t# stair components\r\n\telif hasattr(item, \"GetStairs\"): return item.GetStairs()\r\n\t# grid segments\r\n\telif item.GetType().ToString() == 'Autodesk.Revit.DB.Grid': \r\n\t\tsc = MultiSegmentGrid.GetMultiSegementGridId(item)\r\n\t\tif sc: return item.Document.GetElement(sc)\r\n\t\telse: return None\r\n\telse: return None\r\n\r\nitems = UnwrapElement(IN[0])\r\n\r\nif isinstance(IN[0], list): OUT = [GetSuperComponent(x) for x in items]\r\nelse: OUT = GetSuperComponent(items)",
"Engine": "IronPython2",
"VariableInputPorts": true,
"Id": "e3c35b2105004cd2bc7b62c5c797f69e",
Expand Down

0 comments on commit b6ef8c0

Please sign in to comment.