Copy Filters & Their Overrides Between Views

dynamo

#1

Hello

I have a script that I used to use to copy filters & their overrides from one view to another (ignoring a Filter if it already existed in the target View). My problem is that the Grimshaw node View.SetFilterVisibility is now deprecated so won’t work. Does anyone know how I can fix the graph to include if the original Filter is Visible or not?

Thanks

0BV View Fs-Copy Filters Between View Templates VT OP.dyn (39.4 KB)


#2

I think this node might have become an OOTB node.

setfilter


#3

Hi

That was the node that I have attempted to use in the graph. It doesn’t present any errors but it fails to change the visibility of the Filters like the old deprecated node did.


#4

We covered this in the advanced Dynamo workshop at AU 2017. 17 minutes in is where we work through this.

Also, here is my graph that I used.


#5

Hi

I managed to fix the graph so that if the filter already existed then it retains it’s original Visibility setting and still inherits the overrides.


#6

Hi all,

I am trying to achieve an improved version of the script posted by @john_pierson, what I mean is that I would like to be able to insert the copied filter/s above/under a certain index which is given by a Reference Filter I name.
In the actual situation, the copied filters are placed at the bottom of the list. I hope I was clear enough for you guys to understand what I am trying to achieve.

Thank you guys in advance !

Copy filters between view templates.dyn (19.4 KB)


#7

I wanted to share this link that outlines how to solve this,
Place View Filter at index?

You will see that the API has no direct way of doing this, so you will need to work out how to remove all the filters and re-add them in the order you want.