SetIsFilterEnabled Lists/Sublists

Hi everyone, I tried to make a python script to enable/disable filters in views but unfortunately I don’t have much knowledge in this art.
My objective is to initiate a project from sheets (Google sheet), I was able to extract the informations/make the views/filters/…
In this example I have 3 filters to apply to 2 views and 6 bools (1 for each).
The result here: all filter are disabled(or enabled) depending on the latest bool


Here is the script :

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

view = UnwrapElement(IN[0])
viewfilter = UnwrapElement(IN[1])
bool = IN[2]

TransactionManager.Instance.EnsureInTransaction(doc)
count = 0
for v in view:
for vf in viewfilter:
for b in bool:
v.SetIsFilterEnabled(vf.Id,b)
TransactionManager.Instance.TransactionTaskDone()

OUT = IN[0]

Please elp :melting_face:

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

view = UnwrapElement(IN[0])
viewfilter = UnwrapElement(IN[1])
bool = IN[2]

TransactionManager.Instance.EnsureInTransaction(doc)
count = 0
for v in view:
for vf in viewfilter:
for b in bool:
v.SetIsFilterEnabled(vf.Id,b)
TransactionManager.Instance.TransactionTaskDone()

OUT = IN[0]

so IN[0] can`t be at out when it is already in “view”

you make "for loops " they do not collect something or append…

just descripe your attention

KR

Andreas

Alright thanks.
I don’t particularly need anything OUT, I just need to control the filters to be enable or disable for each views like in the first image.
bool

I’m a little lost sometimes to fully comprehend levels when I have to input lists with nested lists and lacing, so making a node to work like that is kind of difficult with no experience ^^