Surrounding elements

Hi,

I am trying to get the visible sections in a current view i thought GetSurroundingElements do this, but it doesn’t work with sections or views.
How do i get the visible sections in a current view?

thnks.

in Python you can ry using a Collector with Built-in Category of ‘OST_Sections’

In addition to @ashwinash112’s post, you can try this python.
I haven’t tested it yet.

doc = DocumentManager.Instance.CurrentDBDocument

collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Sections)

ActView = UnwrapElement(IN[0])

notHiddenList =

for s in collector:
notHidden = s.IsHidden(ActView)
if(s == false):
notHiddenList.append(s)

OUT = notHiddenList

It is based on the “IsHidden” method for elements. If the element is not hidden in the active view it will appear on the list “notHiddenList”.

I am not familiar with Python jet, so i tried your code but get error "unexpected token ‘’.
sections

I just tried the code and I can’t get anything out of the sections. Walls, etc. is no problem but sections can’t. Sorry :slight_smile:

to bad thanks anyway

I did try with spring nodes too.
Springs.Collector.ElementsInViews throws an empty list too.

Try getting active view elements and filter views and then view types.

i believe that sections don’t belong to active view elements so i can’t retrieve them.

By the way what i want is to set the rebar View Visibility State only unobscured (tick on) to the sections that shows the rebar. In the pic below only in “test”, “Section 1”, “Section 2” and “Section 5”.

rebar%20Visibility%20state

1 Like

Suggestion - Use section as active view and get all elements active view filter the rebar types in each section use that as reference in schedule to check or uncheck.

Thank you for your reply but as i sad before i can’t filter section in active view because the don’t exsist in the list of elements.
rebar%20sections%20II

Sorry i didn’t explain properly,

and then find if rebar is visible in that view then name it accordingly

yes, but how i know (in dynamo) witch sections belong to the current view (section) my example is not a planview but a section view.

Sure i can ask the user to select the sections but i want dynamo to get all section in the current view (section)

Manage to figure it out.

thanks to @awilliams and @Kulkul in this topic How to get All Annotation Elements In Active View - section marks, elevation tags etc - #5 by Kulkul

you must not try to look for sections but have to search for views.

viewers.append(FilteredElementCollector(doc, v.Id).OfCategory(BuiltInCategory.OST_Viewers).ToElements())

thnks for your reply’s