OfCateogry() takes exactly 2 arguements error

I’m just trying to use OfCategory in a FilteredElementCollector and I feel like this has always had one argument.

views = ((FilteredElementCollector.OfCategory(BuiltInCategory.OST_Views)
         .WhereElementIsNotElementType()
         .WherePasses(ElementParameterFilter(FilterStringRule(ParameterValueProvider(ElementId(BuiltInParameter.SYMBOL_NAME_PARAM)),FilterStringEquals(),"Legend Creation", True))))
         .ToElements())
IronPython Traceback:
Traceback (most recent call last):
 File "L:\Revit\Development\PyRevit\DevTool\DevTool.extension\DevTools.tab\Family Tools.Panel\GenerateImageofFamily.pushbutton\GenerateImageofFamily_script.py", line 38, in <module>
TypeError: OfCategory() takes exactly 2 arguments (1 given)

OfClass is giving me the same error.

How are you passing the doc?

I’m passing the doc by not doing that at all and then posting on the forum and waiting until someone asks how I’m doing that. LOL

FilteredElementCollector(doc).

Thank you, now to just try to get the wherepasses to work.

1 Like