Duplicating schedules and applying filters

EDIT: Upon further thought, is it possible to simply make a user input on how many times the entire script should run??

Hi everyone,

I have a script that duplicates an existing schedule by the amount of levels in the project, then renames and applies filters accordingly. This works great.
Where I am struggling is when I try and add an additional schedule to the process. The current process works perfectly when I simply select one schedule to duplicate and apply filters to such as “Mechanical Equipment”, but I need to be able to select multiple schedules to apply the process to. As soon as I add an additional schedules, the filters don’t get applied correctly and I can’t figure out why.
If someone could help me with this I would really appreciate that!
I have tried to include as much info in the screenshot as possible.

This is what currently works for one schedule.

Here is the same screen when I select two schedules:

EDIT: Upon further thought, is it possible to simply make a user input on how many times the entire script should run??

So, this is an interesting one to test out, for the view duplicate part, you need to create a view name for the other schedules, as of right now it’s just generating one view name for the first schedule in your list. In your code block, you can tell it to work at level 1 by inserting “@L1<1>” after the variable LevelName (LevelName@L1<1>). This will generate a view name for the additional schedules in your list for duplicating.

I also transpose the list after the name generation so it aligns the view name with the inserted view for when we duplicate it and it’ll have the appropriate name. Then, in your view duplicate, you’ll need to adjust the lacing for the view to @Level1. This will work if the user selects one or multiple schedules.

I hope this helps with the duplication part, I am still toying around with the apply filter part.
Thanks,

2 Likes

Hi Patrick,

Thank you very much for your response and the assistance, I will try this out as soon as I get to work tomorrow and report back!

1 Like

Hi Patrick,

Gave your solution a try and it works perfectly, thank you very much!

Now to figure out how to apply the filters, which I am still struggling with…

1 Like

Managed to solve this issue and get it working! Thanks again Patrick for pointing me in the right direction initially! helped a lot.

1 Like

You’re very welcome! If you don’t mind, what was the solution for applying the filters? I have a hunch on what needs to happen.
Also, if you felt that my response was indeed the answer, could you mark it as such?

Cheers,

1 Like

The solution was quite simple in the end:

I set my level down to 1 for my AddFilters node, and transposed and flattened the info coming out of the ScheduleFilter node as well as setting the lacing from longest back to auto and that did the trick!

Thanks again.

1 Like

Awesome! Very well done!

1 Like