Hide section in view

Hello community,

We would like to retrieve visible sections on view.

There are a couple of nodes to read elements from current view or selected view but none of them list the visible views within the view.

The reason behind this is that we’d like to hide sections that do not match the same sheet number, so instead of setting a boolean mask for all the sections we’d like to only consider the one visible in the view and not all.

I hope this all make sense.

hi,

I made this to retrieve all sections within a view (section).

Enable Python support and load DesignScript library

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

views =
if isinstance(IN[0],list):
for i in IN[0]:
views.append(UnwrapElement(i))
else:
views.append(UnwrapElement(IN[0]))

viewers =
for v in views:
viewers.append(FilteredElementCollector(doc, v.Id).OfCategory(BuiltInCategory.OST_Viewers).ToElements())

OUT = zip(viewers)

Many thanks EzDoeslt!!!

We’ll try this one out.