TypeError : Expected IEnumerable[Category] , got Category

I’m trying to create a filter using Python script but I get this type of errors :
TypeError : Expected IEnumerable[Category] , got Category

Add that one to your code:

if not hassattr(your_variable, "__iter__"):
     your_variable = [your_variable]

Still sending the same message error

Post the code here and error message…

1

What you are trying to do?

I’m trying to create some filters , each one with a specific rule

in API there are another categories for filters… The problem might be there.

Take a look here:

It wouldn’t help for my case because I need ParameterFilterElement.ByRules method

that class does not have “ByRules” method in API.

https://www.revitapidocs.com/2019/e8cb5c2b-b8ca-cbbf-819b-6956e0fd0760.htm