I have a python node where I’m using 2 FilteredElementCollectors to filter my initial Revit selection. One for Cable Tray one for Cable Tray Fittings. I realized after I made these that I actually want to output two different lists - one with just the cable tray, one with cable tray & cable tray fittings.
I could make a ElementMulticategoryFilter and all that, but I figure I already had the two written out, it should be simple enough to just combine the two, but I seem to be having trouble making that work.
Here’s the code:
# Enable Python support and load DesignScript library
import clr
# Import RevitAPI - This gives general access to Revit tools.
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import BuiltInCategory as bic, Element, ElementId, FilteredElementCollector
# The System namespace at the root of .NET
import System
from System.Collections.Generic import List
# Import DocumentManager & TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
# Start Code
sel = uidoc.Selection.GetElementIds()
ct = FilteredElementCollector(doc, sel).OfCategory(bic.OST_CableTray).ToElements()
ctf = FilteredElementCollector(doc, sel).OfCategory(bic.OST_CableTrayFitting).ToElements()
# Assign output
OUT = ct, ct.Concat(ctf)
I get the error mentioned in the title when I try to run this. I also tried ct.Union(ctf) but no luck there either. Am I missing something in the imports, or does IronPython not support these methods or some such?