# Remove Specific Schedule Filter Without Clearing All

**URL:** <https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294>\
**Category:** Revit\
**Tags:** schedule\
**Created:** [February 20, 2024, 11:15pm UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294 "2024-02-20T23:15:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SURFACEFUSION](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/surfacefusion/32/175913_2.png) [@SURFACEFUSION](https://forum.dynamobim.com/u/SURFACEFUSION)\
**Post date:** [February 20, 2024, 11:15pm UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294/1 "2024-02-20T23:15:32Z")

</div>

I can add filters to a schedule, but is there a way to remove them? I see ClearAllFilters, but I want to remove a specific filter and leave others untouched. Am I missing something?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/e/6e47aa56abd6bd2b6da5b36c48400d733fcf8380.png)

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [February 20, 2024, 11:48pm UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294/2 "2024-02-20T23:48:28Z")

</div>

I’m pretty sure the only way would be to clear filters then re-add all but the intended ones. If you try to remove a filter in Revit naturally, you’ll notice it wipes out all filters below it, so pretty sure Dynamo would suffer from this if it supported removal.

---

<div class="post-metadata">

**Author:** ![pyXam](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pyxam/32/163009_2.png) [@pyXam](https://forum.dynamobim.com/u/pyXam)\
**Post date:** [February 20, 2024, 11:53pm UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294/3 "2024-02-20T23:53:50Z")

</div>

Would this node suit your requirements?

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/e/2ef441c63809f2158415b75b6ebbf981cbc380f8.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [February 21, 2024, 2:07am UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294/4 "2024-02-21T02:07:39Z")

</div>

> [@GavinNicholls](#):
>
> If you try to remove a filter in Revit naturally, you’ll notice it wipes out all filters below it, so pretty sure Dynamo would suffer from this if it supported removal.

I think it’s be doable via the API. There is a ‘remove filter’ method that takes the Element Id of the Filter element. There is also a GetOrderedFilters method to get a list of the filters in the order provided. Only question is if the filters provided differ between schedules and views as these are inherited methods. You might have to enable/disable the filters as you go, or force a regen though. Worth poking around of there is desire and someone has time.

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [February 21, 2024, 2:22am UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294/5 "2024-02-21T02:22:24Z")

</div>

Interesting… maybe they built it in as a helper behind the scenes to avoid the filter collapse. I’ll try to get a look into this shortly, as I feel like I didn’t get this to work another time I was trying to define filters in schedules. Maybe I can prove past me wrong.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [February 21, 2024, 2:35am UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294/6 "2024-02-21T02:35:25Z")

</div>

> [@GavinNicholls](#):
>
> Maybe I can prove past me wrong.

This is like 90% of my job lately. 🤣

---

<div class="post-metadata">

**Author:** ![gerhard.p](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gerhard.p/32/147675_2.png) [@gerhard.p](https://forum.dynamobim.com/u/gerhard.p)\
**Post date:** [February 21, 2024, 2:59am UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294/7 "2024-02-21T02:59:15Z")

</div>

I can confirm that it works 🙂  
It is possible to remove one filter without effecting the others.

Notice that these method for schedules does not take an element id, it works by index.  
It´s the method for views that takes an id.

> **[RemoveFilter Method](https://www.revitapidocs.com/2023/57b69056-4175-3de4-511f-c1a1af280300.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

```auto
import clr

clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')

from Autodesk.Revit.DB import ViewSchedule
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

schedule = UnwrapElement(IN[0])

TransactionManager.Instance.EnsureInTransaction(doc)

# remove filter by index
schedule.Definition.RemoveFilter(0)

TransactionManager.Instance.TransactionTaskDone()

```

@SURFACEFUSION , if you are not already familiar with that procedure, you will need a python script node and copy/paste the code!

---

<div class="post-metadata">

**Author:** ![SURFACEFUSION](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/surfacefusion/32/175913_2.png) [@SURFACEFUSION](https://forum.dynamobim.com/u/SURFACEFUSION)\
**Post date:** [February 21, 2024, 3:58pm UTC](https://forum.dynamobim.com/t/remove-specific-schedule-filter-without-clearing-all/98294/8 "2024-02-21T15:58:36Z")

</div>

This worked beautifully! I swapped out the “0” in the schedule.Definition.RemoveFilter for an “IN[1]” and I was able to input both the scheduleView and the index of the filter to remove. Thanks for all your help!

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/a/4a277db47591402f6dd5ded3b27b565be7481356.png)
