Replace Schedule Filters

Hi all,
Thanks in advance for any advice. I’m trying to build a find/replace for schedule filters. Here is what I have so far which does not come back with any errors and my final watch result seems correct. However, it is not making the actual change to the filter in revit… I must have missed something. Ideally i’d like to be able to run this for multiple schedules at the same time, but I’m just starting with one.

Schedule Replace Filter.dyn (11.3 KB)


Filter%20Properties !

My best guess is that you don’t need to do all the stuff circled in blue, the value input in ScheduleFilter.ByFieldType… is just a string

To confirm, please show us the output of String.Replace

Hey,

I might be wrong, but I think the OP needs that part of the graph to edit the value before it’s inputted?

My guess is that the input is currently a list containing a string… I would add a code block with x[0] and see if that helps… or @L1 to the ‘by parameter node’

image

I might be wrong :smiley:

Mark

The string replace is there because ideally I can use this for multiple schedules and changes all 1s to 2s or As to Bs. But even if I just use a string for the input, it doesnt change the filter at all.

Mark,
Thanks, i did try that just now with my fingers crossed, but still nothing. What really confuses me is that the output says the filter has been changed correctly. Im used to getting errors that help me figure out whats wrong, Im stumped when it says it worked…

Like this maybe? :slight_smile:

Thanks! i knew there was a simpler way, sometimes i over think it too much.
Did this work for you? It works for me if Im creating a new filter, but still wont let me replace the existing filter text.

As far as i know you can’t replace filter. First you need to clear other filters and then add the ones you want.

1 Like

Well that sucks, I was really hoping to be able to just replace one number or letter in a bunch of schedule filters at once on a per project basis, vs opening each schedule and editing the filter. While your script does work for deleting and adding a new filter, Im not sure how much time it saves me. thank you for the input :slight_smile:

That node is for view filters. it’s not working with schedule filters :slight_smile:

I just noticed that

I see. Maybe this one can save you a little more time :slight_smile:
The idea is;
1 define the filter you wanna change
2 drop the old filter from list
3 create a new filter list which contains other filters and the new filter
4 clear all filters
5 add your new filter list

2 Likes

So I tried it your way, but a little simpler, just to clear all filters and then use the schedule filter by field, type and value node to add the new filter and I still get no error, yet no new filter added. It did actually remove the old one, though. So I thought my graph was faulty and tried it exactly the way you have above and I get a similar result. The old filter is removed, but no new one added. What am I missing here?


You forgot to add the “ScheduleView.AddFilters” node.

smiley emoticons

Thanks! I totally missed that, not enough coffee yesterday haha

While Im here, does anyone know if there is a way to feed multiple schedules into the ClearAllFilters Node?

You can use filterbyboolmask node

or you can use UI nodes from datashape packages.


Thanks!