Turning off the visibility off a newly created view filter

Hi,

I’m having a lot of trouble with a Dynamo script i’m writing. I don’t think that the purpose of the whole script is not all relevant to my question but I’ll write it down in Italics just in case.

The purpose of the script is to create two views (a Front view and a Cross section of a selected column). These views are then duplicated so that I have a view for annotating and a view for modelling rebar. Each column has a code that is used to name the two created views. The duplicated views have the same name with “ref” added at the end. These ref views have Sections turned on in the graphic overrides so that they can be adjusted while modelling the rebar. This all works perfectly. The only problem is that if I run this script for multiple colums, the ref views show all the Sections that I have just created, which clutters the views.

I wanted to solve this by creating a view filter. I’m creating a view filter for each columns with a doesnotcontain-rule for the View name, where I add the code of the column. If the visibility of the view filter is turned off, all the sections that do not contain the columns code will be turned off. This View filter is then applied to the ref views of the corresponding column. This view filter are created correctly and applied to the correct views, so no problems here.

The problem that I haven’t been able to solve all day is that I just cannot manage to have the visibility of the view filter turned off automatically. They are created and added to the views, but no matter what I do they always have the visibility turned on. I have added a screenshot of the part of the script that creates the view filter. I have already tried switching the boolean value for hide to False, but to no avail.

Looks like you are missing overrides.

you can use empty overrides as show below.


I hope this solves your problem.

1 Like

Adding empty overrides (and setting the ‘hide’ value to false) solved my problem.

Thank you very much.

I bumped into another problem with the script. I’m not sure if you would know the answer to this one as well.
The script works perfectly when I select one column, however when I select multiple columns, the script creates and assigns the filters correctly, but it adds all of the rules to all of the filters.

So instead of having filter 1 with rule 1, filter two with rule 2, etc. I have filter 1 with rule1 and rule 2, filter 2 with rule 1 and rule 2,…

Do you have any idea how I would be able to solve this?

Try using levels. Soo Filter name should be at level 1, then rules at level 2, and to be sure use lacing Longest.

That does not work unfortunately, however I was trying out some stuff with levels and sublists, and if I split the two lists into sublists and then use Levels 1 for both it works. It doesn’t seem like it should based on my understanding of Dynamo, but then again I am quite inexperienced with Dynamo. :man_shrugging:

Yup im talking what I would first try, but since i cant see lists from your picture its hard to say anything :smiley:.
Also for next questions it would be best to start a new thread :wink:

1 Like