Unhide in All Views/Sheets

 

Hello, My goal here is to take a list of elements and Unhide all of them in all views and sheets if they have been hidden manually. An example workflow that we are trying to use is to select all revision clouds of a particular revision and unhide them everywhere. T

he selection is no problem but I am having trouble with an unhide node. I have almost no skill at Python but I have tried the cut and paste method to come up with the following (it does not work). I was hoping someone could help correct it or offer a better one.

Thanks

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

Import DocumentManager and TransactionManager

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

Import RevitAPI

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

from System.Collections.Generic import *

doc = DocumentManager.Instance.CurrentDBDocument

elements = []
for i in IN[0]:
elements.append(UnwrapElement(i))
view = UnwrapElement(IN[1])

idsToHide = ListAutodesk.Revit.DB.ElementId
for i in elements:
idsToHide.Add(i.Id)
TransactionManager.Instance.EnsureInTransaction(doc)
View.UnhideElements(idsToHide, view)
TransactionManager.Instance.TransactionTaskDone()
OUT = idsToHide

 

Hi Sean,

Here is the better picture:

Before

Untitled

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After

hide

Thanks. It works well for a single view, but I am looking to feed it a list of views. I tried modifying the Unhide command with a for statement to process all the views but no luck. I clearly am not good at this python thing.

Suggestions?
Thanks

 

for vu in view
vu.UnhideElements(ielements)

 

Yep, forgot a :

works fine.

Thanks.