From ea6655692cb470c24e451cd7bbb5e0028ce799f0 Mon Sep 17 00:00:00 2001 From: "GMP-AD\\adieckmann" Date: Fri, 26 Apr 2024 21:32:51 +0200 Subject: [PATCH] #410 --- nodes/2.x/python/RoomTag.IsInRoom.py | 22 +++ .../2.x/dynamo/Revit.Elements.RoomTag.dyn | 181 ++++++++++++++---- 2 files changed, 170 insertions(+), 33 deletions(-) create mode 100644 nodes/2.x/python/RoomTag.IsInRoom.py diff --git a/nodes/2.x/python/RoomTag.IsInRoom.py b/nodes/2.x/python/RoomTag.IsInRoom.py new file mode 100644 index 00000000..e25698b0 --- /dev/null +++ b/nodes/2.x/python/RoomTag.IsInRoom.py @@ -0,0 +1,22 @@ +import clr +clr.AddReference('RevitAPI') +from Autodesk.Revit.DB import * +import Autodesk + +clr.AddReference("RevitNodes") +import Revit +clr.ImportExtensions(Revit.GeometryConversion) + +clr.AddReference("RevitServices") +import RevitServices +from RevitServices.Persistence import DocumentManager + +def TagIsInRoom(tag): + if hasattr(tag, "IsInRoom"): return tag.IsInRoom + else: return False + +doc = DocumentManager.Instance.CurrentDBDocument +roomtags = UnwrapElement(IN[0]) + +if isinstance(IN[0], list): OUT = [TagIsInRoom(x) for x in roomtags] +else: OUT = TagIsInRoom(roomtags) \ No newline at end of file diff --git a/package_samples/2.x/dynamo/Revit.Elements.RoomTag.dyn b/package_samples/2.x/dynamo/Revit.Elements.RoomTag.dyn index 6a08e6bb..d3f3e342 100644 --- a/package_samples/2.x/dynamo/Revit.Elements.RoomTag.dyn +++ b/package_samples/2.x/dynamo/Revit.Elements.RoomTag.dyn @@ -176,6 +176,66 @@ ], "Replication": "Auto", "Description": "Ruft eine Revit-Kategorie anhand des integrierten Kategorienamens ab.\n\nCategory.ByName (name: string): Category" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Function, DynamoCore", + "FunctionSignature": "1818be0d-68d9-4702-8d4b-e87e6608755e", + "FunctionType": "Graph", + "NodeType": "FunctionNode", + "Id": "2ccd9248526b4036a2450f9822806b0f", + "Inputs": [ + { + "Id": "f90b8b5557184fea81bdb40040dc2556", + "Name": "roomTag", + "Description": "var[]..[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "b565e374e0f346a49488c599c744b125", + "Name": "bool", + "Description": "Rückgabewert", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Auto", + "Description": "Checks if a room tag is located within the boundaries of the room it is tagging" + }, + { + "ConcreteType": "CoreNodeModels.Watch, CoreNodeModels", + "NodeType": "ExtensionNode", + "Id": "63dde17ee8d64e4a9f3e24dd723d96f0", + "Inputs": [ + { + "Id": "2f08e5fe52ce4ead8e5edbf7a0deb8ea", + "Name": "", + "Description": "Block, dessen Ausgabe angezeigt wird", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "1a15b772bcfe486584767416b060ef78", + "Name": "", + "Description": "Blockausgabe", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Visualisierung der Ausgabe des Blocks" } ], "Connectors": [ @@ -194,6 +254,11 @@ "End": "d81c0ab928c3473594785077e5fbb838", "Id": "99e8c466915c400783dd26a37fd96563" }, + { + "Start": "e76faeb456ed4af493da06175841e273", + "End": "f90b8b5557184fea81bdb40040dc2556", + "Id": "a80ae1d51bac4098b27506b6af2867f7" + }, { "Start": "3dcfaf0fa68f47f990b3523de76eda8c", "End": "0fc046172fe841108e5f28b4de560ac7", @@ -203,10 +268,16 @@ "Start": "d9bf45ed22964e49b9db4854c26dce98", "End": "4171d04eceb44130adfe9f114e7ad77a", "Id": "68d96fdb7cce4fd1bc0e38de6118796e" + }, + { + "Start": "b565e374e0f346a49488c599c744b125", + "End": "2f08e5fe52ce4ead8e5edbf7a0deb8ea", + "Id": "65106325ca884cd38a64b8e7fd4f138a" } ], "Dependencies": [ - "6367a8db-eab0-4473-8672-df51384ed1f8" + "6367a8db-eab0-4473-8672-df51384ed1f8", + "1818be0d-68d9-4702-8d4b-e87e6608755e" ], "NodeLibraryDependencies": [ { @@ -216,9 +287,17 @@ "Nodes": [ "25d1037c9bf342338920c14a0534ed9f" ] + }, + { + "Name": "Clockwork for Dynamo 2.x", + "Version": "2.6.0", + "ReferenceType": "Package", + "Nodes": [ + "2ccd9248526b4036a2450f9822806b0f" + ] } ], - "Thumbnail": null, + "Thumbnail": "", "GraphDocumentationURL": null, "ExtensionWorkspaceData": [ { @@ -265,64 +344,84 @@ }, "NodeViews": [ { - "ShowGeometry": true, - "Name": "RoomTag.Room", "Id": "25d1037c9bf342338920c14a0534ed9f", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "RoomTag.Room", + "ShowGeometry": true, "Excluded": false, - "X": 1695.4509694528779, - "Y": -206.05222026961212 + "X": 1655.0981940647223, + "Y": -195.32237559478966 }, { - "ShowGeometry": true, - "Name": "All Elements of Category", "Id": "326ee14ad68744eb9331422fa8cbc06c", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "All Elements of Category", + "ShowGeometry": true, "Excluded": false, - "X": 1105.8862727586923, - "Y": -204.95077095994554 + "X": 1061.0981940647223, + "Y": -11.137436226918737 }, { - "ShowGeometry": true, - "Name": "Watch", "Id": "67fd1b661fcf41fca21536376b01b2d8", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "Watch", + "ShowGeometry": true, "Excluded": false, - "X": 1385.4509694528779, - "Y": -206.05222026961212 + "X": 1335.0981940647223, + "Y": -11.137436226918737 }, { - "ShowGeometry": true, - "Name": "Watch", "Id": "b58c3a5043d449fda21bee70a2304fe2", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "Watch", + "ShowGeometry": true, "Excluded": false, - "X": 2002.4509694528781, - "Y": -206.05222026961212 + "X": 1978.34477988855, + "Y": -193.69771701240694 }, { - "ShowGeometry": true, - "Name": "String", "Id": "f3af626cfd5d47e99d56da8564119d35", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "String", + "ShowGeometry": true, "Excluded": false, - "X": 476.91560346807705, - "Y": -207.38410359542024 + "X": 535.09819406472229, + "Y": -11.137436226918737 }, { - "ShowGeometry": true, - "Name": "Category.ByName", "Id": "428b56fda78f47688874910a50f63704", "IsSetAsInput": false, "IsSetAsOutput": false, + "Name": "Category.ByName", + "ShowGeometry": true, "Excluded": false, - "X": 776.915603468077, - "Y": -207.38410359542024 + "X": 753.09819406472229, + "Y": -11.137436226918737 + }, + { + "Id": "2ccd9248526b4036a2450f9822806b0f", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Name": "RoomTag.IsInRoom", + "ShowGeometry": true, + "Excluded": false, + "X": 1655.0981940647223, + "Y": 173.04750314095219 + }, + { + "Id": "63dde17ee8d64e4a9f3e24dd723d96f0", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Name": "Watch", + "ShowGeometry": true, + "Excluded": false, + "X": 1981.3463368438745, + "Y": 168.67762440521034 } ], "Annotations": [ @@ -331,17 +430,33 @@ "Title": "RoomTag.Room", "Nodes": [ "25d1037c9bf342338920c14a0534ed9f", - "67fd1b661fcf41fca21536376b01b2d8", "b58c3a5043d449fda21bee70a2304fe2" ], - "Left": 1375.4509694528779, - "Top": -259.25222026961211, - "Width": 846.60000000000036, - "Height": 330.59999999999997, + "Left": 1645.0981940647223, + "Top": -248.32237559478966, + "Width": 553.24658582382767, + "Height": 332.62465858238272, "FontSize": 36.0, - "InitialTop": -206.05222026961212, + "InitialTop": -195.32237559478966, "InitialHeight": 145.0, - "TextblockHeight": 43.2, + "TextblockHeight": 43.0, + "Background": "#FF48B9FF" + }, + { + "Id": "09ba3cc7873d446c82574ae9f37bd941", + "Title": "RoomTagIsInRoom", + "Nodes": [ + "2ccd9248526b4036a2450f9822806b0f", + "63dde17ee8d64e4a9f3e24dd723d96f0" + ], + "Left": 1645.0981940647223, + "Top": 115.67762440521034, + "Width": 556.248142779152, + "Height": 331.0, + "FontSize": 36.0, + "InitialTop": 168.67762440521034, + "InitialHeight": 308.0, + "TextblockHeight": 43.0, "Background": "#FF48B9FF" } ],