Categories vs. Category.ByName Discrepancy in 2.13

Hello @jpclark - The bad news is that this is a regression that slipped through :frowning: The good news is that this is a known issue that the team is working on :slight_smile:

The node under the hood is here - DynamoRevit/Category.cs at a90305ebc8fe2227d646760233a12f33ccc75046 路 DynamoDS/DynamoRevit 路 GitHub if you are curious to looking.

In the interim, I suggest you either use the Category dropdowns, or a Python Filtered Element Collector. Shoutout to @Konrad_K_Sobon for the base code that was modified below.

import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import BuiltInCategory,ElementMulticategoryFilter,FilteredElementCollector

import System
from System import Array
from System.Collections.Generic import List

try:
    errorReport = None
    
    cat_list = [BuiltInCategory.OST_Rooms, BuiltInCategory.OST_Ceilings, BuiltInCategory.OST_Floors, BuiltInCategory.OST_Roofs, BuiltInCategory.OST_Stairs]
    typed_list = List[BuiltInCategory](cat_list)
    filter = ElementMulticategoryFilter(typed_list)
    output = FilteredElementCollector(doc).WherePasses(filter).ToElements()

except:
    # if error occurs anywhere in the process catch it
    import traceback
    errorReport = traceback.format_exc()

# Assign your output to the OUT variable
if None == errorReport:
    OUT = output
else:
    OUT = errorReport