Add Selection Filters to views

Hello all,

I am trying to add a Selection Filter to a list of views. When I pass a Parameter Filter to View.SetFilterOverrides everything works great. If I change nothing but give it a single Selection Filter it gives me this “Warning: One or more of the input types are not matching. Couldn’t find a version of SetFilterOverrides that takes arguments of type (__array,__array,__array,__array)”

Do any of you know anything about this or know a work around?

Thanks,

It seems this node doesn’t appear to accept SelectionFilterElements anyway:
image

API Docs show they are two separate classes, but both fall under FilterElement Class:

ParameterFilterElement Class
SelectionFilterElement Class

Should be able to do it with a Python script using the SetFilterOverrides Method, or maybe there is a package out there that has a node for this already that I’m unaware of :slight_smile:

2 Likes

@awilliams is correct that this node doesn’t accept Selection Filters. I posted a request to GitHub so that the devs are aware of your wish:

Cheers!

2 Likes

Hi, have you successfully done want you want ?

I’m interested to know how you did it and how you get all your selection Filter in current document.

Thank you.

Hi, I am very interesting too. How to Selection filter as a view filter ?

Please :slight_smile:

hello @baud.dem
When you create a Selection-Based Filter this automatically creates a filter

then, there is an example to Add a Selection-Based Filter to a view Template

1 Like

Your code works very fine danke. I was also working on a code but it has a color issue that I couldn’t yet solve. Good idea to use the templates ! Bravo.

We agree that it doesnt work for a view without template ? :slight_smile:

yes (for this Python script)