On all my views on sheet i want to get the hidden elements(section) but they won’t show unless the toggle button “Reveal Hidden Elements” is on.
Is there a way to set all views on sheet in “Reveal Hidden Elements” mode to get the hidden elements?
Or any other way?
thanks.
You can use the EnableRevealHiddenMode and DisableTemporaryViewMode methods to toggle the visibility off and on.
Thanks to you and Chat (gpt)
i manage to get what i want.
On
import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
from RevitServices.Persistence import *
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
views = UnwrapElement(IN[0])
TransactionManager.Instance.EnsureInTransaction(doc)
for v in views:
if hasattr(v, "EnableRevealHiddenMode"):
try:
v.EnableRevealHiddenMode()
except:
pass
TransactionManager.Instance.TransactionTaskDone()
OUT = views
off
import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
from RevitServices.Persistence import *
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB import TemporaryViewMode
doc = DocumentManager.Instance.CurrentDBDocument
views = UnwrapElement(IN[0])
# Zet Reveal Hidden Mode uit
TransactionManager.Instance.EnsureInTransaction(doc)
for v in views:
if hasattr(v, "DisableTemporaryViewMode"):
try:
v.DisableTemporaryViewMode(TemporaryViewMode.RevealHiddenElements)
except:
pass
TransactionManager.Instance.TransactionTaskDone()
OUT = views
Well done. Just to be safe, it’s probably a good idea to use a Wait/Passthrough node to make sure that you don’t toggle hidden elements back off until after they’ve been identified.