Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Nov 11, 2023
1 parent dcab13d commit a3d087a
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions nodes/2.x/python/All Elements Of Category+.py
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions nodes/2.x/python/All Family Types Of Category.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a3d087a

Please sign in to comment.