Hide section's that are not on printed sheet

Dear all,

I came today at my office with a specific idea for my next Dynamo scrip.

My wish is simple:
When i place a floorplan view on sheet and add some sections views on it, I would like to hide (on my floorplan view) all section lines that are not on my printed sheet.

I managed to create a script that collect all sections on the active view and get the parameter “Sheet Name” for all of them.
Then i compare wit a boolean list if the sections are refering to the same “Sheet Name” as the active view.

This is working great.
But after that, I would like to hide all sections that doesn’t have the same “Sheet Name” as active view.
I tried the View.HideElements node but i always get an error message:
"AttributeError: “str” object has no attribute “IsHidden”

I looked at all topics on this forum linked to my problem but I still don’t understand why my script doesn’t want me to hide those elements. …

Any ideas?
Thanks

BV_Cache coupes non sur feulle test2.dyn (37.7 KB)

We made new types of sections that had the scale of the view in the type name, like “Section-1_50”
from there it was easy filtering.

Thanks Marcel but that’s not what I’m looking for.

Right now, once all my section on the sheet are placed, I create a filter “No view 001” and i apply it to the view.
The thing is that after printing some 50sheets, i have a very huge filter list.
The dynamo script could help me to avoid those filters.

I hope I’m quite reaching the final point with my script but I really don’t understand why it can not hide the elements.

Me again,

Yesterday was a full day trying to understand what’s wrong with my script and I still don’t understand.
The first part of my script to select the view sections I want to hide works perfectly.
But I really have an issue with the HideinView node.

I tryed a python code but didn’t end well neither.

I saw this video showing how to erase an element and it works well with my script.

I saw few other post of people with the same problem as mine but all the solution they got don’t work with me.

BV_Cache coupes non sur feulle test.dyn (32.1 KB)

Hi,
After few days off the script, I finaly managed to do what i wanted!
My mistake was with my flatten list.

Here is my final script in case someone would like to use it

BV_Cache coupes non sur feuille.dyn (32.3 KB)

2 Likes