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