Unhide linked document

Hello Dynamiters,

I am trying to unhide the hided linked document and I am not sure how to do it. I can also not pass the elements Ids of the linked document on the IsolateElementsTemporary() or UnhideElements(). None of these methods works out. I need to use the method IsolateElementsTemporary() to hide other elements on the non linked document.

if intersected_elements_id_list:
	#Create a List
	intersected_elements_id_iColl = List[ElementId](intersected_elements_id_list)
	#Isolate Elements Temporary
	view_3d.IsolateElementsTemporary(intersected_elements_id_iColl)
	#unhide linkeds documents
	view_3d.UnhideElements(cat_elements_2_id)

Any clue? Thanks in advance!

Are you passing the link type or the link instance?

Hello Jacob,

well I am trying to unhide the linked document (Try unhide 01) or trying to unhide the elements of the linked document (Try unhide 02)
None of then works out.

Thanks in advance :slight_smile:

links = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_RvtLinks).WhereElementIsNotElementType().ToElements()
for l in links:
	linkDoc = l.GetLinkDocument()
collector = FilteredElementCollector(linkDoc)
#filter = ElementCategoryFilter(cat_2)
cat_elements_2 = collector.WhereElementIsNotElementType().ToElements()

#Try to unhide 01
unhide_list = List[ElementId]()
unhide_list.Add(links[0].Id)
test_bool = doc.ActiveView.UnhideElements(unhide_list)

#Try to unhide 02
unhide_list_2 = List[ElementId]()
for ele in cat_elements_2:
	unhide_list_2.Add(ele.Id)
test_bool_2 = doc.ActiveView.UnhideElements(unhide_list_2)

Take a very simple project, say a set of walls in a box that is 10x10, save it, and close it. Now link it into a new project. Now copy the link 20 units on the X axis. Notice your project browser only has one link type.

Individual elements can’t be hidden in any case (Revit restriction), nor can the document (as they aren’t an object which has a display). You will need to get the link instances not the link document for this to have a chance. :slight_smile:

thanks Jacob,
actually you were right, you can unhide the link instance, but not the link document. The code below does unhide the linked document

links = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_RvtLinks).WhereElementIsNotElementType().ToElements()

TransactionManager.Instance.EnsureInTransaction(doc)
#Try to unhide 02
unhide_list_2 = List[ElementId]()
unhide_list_2.Add(links[0].Id)

test_bool_2 = doc.ActiveView.UnhideElements(unhide_list_2)
TransactionManager.Instance.TransactionTaskDone()

OUT = unhide_list_2