From a3d087a18db0b77799d03e31fc9b52423d93436c Mon Sep 17 00:00:00 2001 From: "GMP-AD\\adieckmann" Date: Sat, 11 Nov 2023 21:43:19 +0100 Subject: [PATCH] #372 --- nodes/2.x/python/All Elements Of Category+.py | 6 ++++-- nodes/2.x/python/All Family Types Of Category.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nodes/2.x/python/All Elements Of Category+.py b/nodes/2.x/python/All Elements Of Category+.py index 44a809bf..c808bd5a 100644 --- a/nodes/2.x/python/All Elements Of Category+.py +++ b/nodes/2.x/python/All Elements Of Category+.py @@ -8,8 +8,10 @@ from RevitServices.Persistence import DocumentManager def ElementsByCategory(bic, doc): - collector = FilteredElementCollector(doc).OfCategory(bic).WhereElementIsNotElementType() - return collector.ToElements() + if bic: + collector = FilteredElementCollector(doc).OfCategory(bic).WhereElementIsNotElementType() + return collector.ToElements() + else: return [] inputdoc = UnwrapElement(IN[2]) if not inputdoc: doc = DocumentManager.Instance.CurrentDBDocument diff --git a/nodes/2.x/python/All Family Types Of Category.py b/nodes/2.x/python/All Family Types Of Category.py index 93f6ade2..efa9f4a5 100644 --- a/nodes/2.x/python/All Family Types Of Category.py +++ b/nodes/2.x/python/All Family Types Of Category.py @@ -8,8 +8,10 @@ from RevitServices.Persistence import DocumentManager def ElementTypesByCategory(bic, doc): - collector = FilteredElementCollector(doc).OfCategory(bic).WhereElementIsElementType() - return collector.ToElements() + if bic: + collector = FilteredElementCollector(doc).OfCategory(bic).WhereElementIsElementType() + return collector.ToElements() + else: return [] inputdoc = UnwrapElement(IN[2]) if not inputdoc: doc = DocumentManager.Instance.CurrentDBDocument