Hidden elements in a view

When I list (using “Watch”) all elements in active view, obvious, the hidden elements are not listed. Is there a way to list the ones that are hidden? Like I’m passing “All Elements In Active View” through a boolean “false” statement to get the the list of ones that are hidden.

Thanks for help/suggestions.

If you turn on show hidden elements before you run the “All elements In Active View”-node, they will be included in your list. A bit cumbersome but I don’t know any other way.

Here is a python script for separating the hidden/not hidden ones. I’ve also released a package called Element.IsHidden where the elements are sorted in hidden and not hidden.

17

Note that unfortunately there are a number of other ways of hiding elements that will not get picked up by the IsVisible method, e.g. element is in a hidden (sub-)category, element is hidden through use of a view filter, element is part of an invisible workset, element is outside of crop box scope etc.

Yes, I found out after i posted… Couldn’t find any thing in the API for “extracting” hidden categories though? Have you?

Not that it has anything to do with Adrian’s question, but I think the node can serve some purpose in larger projects where users have manually hidden singular objects in some views. (Just a problem that emerges now and then)

Definitely a useful node for model review.

If you want to query the visibility of a given category, you can use Category.Visible …

Joisten/Andreas - thanks for your posts and suggestions.

 

Yes, this is for model review and management of large projects.

 

At this moment I’m working on something like this:

 

  1. get a list of all views that are to be audited

  2. select individual views or all

  3. (temporary) duplicate these views

  4. show all elements in these views

  5. create a list with all elements.

  6. store that info.

  7. delete duplicated views

  8. get a list of visible elements in initial views that were to be audited.

  9. compare the two lists (for a view) and print out elements that are not visible.

 

At least this is the initial “sketch”, but most likely I’ll adapt it and change it as I work on.

As usual better solutions are coming into my head after I finish a task.

 

Thanks for help and suggestions.

I’ll post things as I progress.

 

Adrian: That seems like a sound approach. Altermatively, you could toggle the view to display hidden elements (as Jostein suggested) - I think this might actually be possible using the Revit API (not sure, though).

Jostein: I just remembered I actually made a custom node called View.CategoryIsVisible a year ago that is included in package Clockwork to query the category visibility.

I have just resolved the first step of my process and I am looking way to improve it.

Perspective views are created with element select, now I should turn on the hidden ones before putting those on sheet.

This passage

  1. show all elements in these views

could be done within Dynamo or you have pass through the Revit tools?

Other better solutions came to your head?

Second, I have not find the way to apply a template to the perspectives I am to create…maybe there is something in some personal packages, or deep in the archive (Yes in Revit it is quick and easy, but I would prefer to get them done, before handling Revit tools).

Hi All,

I am trying to get a count of all the hidden elements in all views I have attempted to alter the python script of Jostein’s custom node but it doesn’t seem to be working for me. Can anyone help.

Hidden Elements - Test.dyn (4.0 KB)
indent preformatted text by 4 spaces

import clr

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

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

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

elements = UnwrapElement(IN[0])
views = UnwrapElement(IN[1])
listen=

for element in elements:
for view in views:
listen.append(element.IsHidden(view))

OUT = listen

1 Like

Hi @jostein_olsen,

Thank you for publishing the Element.IsHidden packaged.

It seems that it is only picking up the hidden elements for the Active View. Is this correct?

Thank you
Joaquim

Does this work for hidden linked elements?

There are a few tricks here to catch hidden elements universally, but none of them catch everything except the CustomExporter method. https://thebuildingcoder.typepad.com/blog/2013/08/determining-absolutely-all-visible-elements.html.

Some tricks:
element.IsHidden catches things hidden by category, by element and even for Rooms and elements not able to be shown due to Phase settings of a view, but it does NOT catch elements that are not visible in a view due to Design Option settings.

element.get_boundingbox(view) is another good universal catch, but it’s a slow operation, and it also doesn’t catch elements that are not visible by design option settings.

element.IsHidden also doesn’t catch elements in linked models that are not visible due to the WorkSet not visible. Check Workset.IsVisible() for this.

My main issue now is that nothing I can find catches if an element is not visible due to Design Option settings, and the Design Option settings for a View are not accessible as far as I can find for a View with RevitAPI. Kind of screwed here unless using CustomExporter. What I want to know is what CustomExporter does that catches everything in the View, and why don’t we have access to all of these methods with RevitAPI?

Hi All,

This video show how to get hidden elements in Active View

Revit Dynamo - Get Hidden Elements in Active View