Best method for replacing schedule filter?

Hello, and thank you for the advice in advance.
I have a script that adds a filter to a schedule, but what I really want to do is replace an existing filter (if it exists) and not just overlay the new one. I don’t think there is a node “ScheduleView.DeleteFilters” or anything like that is there? If so I could simply delete any filters before I add the new one.

Specific application is to automatically set a schedule of generic annotations so that a certain parameter (“sheet number”) must be equal to the sheet number that the schedule is assigned to.

(I have another script that sets “sheet number” in each GA automatically)

okay, sorry, I discovered the “dynamo dictionary”, looked up “scheduleview”, and then found “ClearAllFilters”
works swell!

Can you share the script for Filters.

It is a bit of a mess right now but I can post it later once I clean it up. I think there are other good examples if you search for scheduleview, schedulefilter

You can use mine, I just got it to work
Duplicate a schedule, rename it, replace the line one filter

2 Likes