I'm trying to hide a ModeltemCollection. I create the collection and select it. All of the modelitems are highlighted in the view, bit not the Selection Tree. I'm creating the modelitemcollection from a selected item.
foreach (ModelItem item in Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems)
if (item.AncestorsAndSelf != null)
if (item.Descendants != null)
if you call doc.CurrentSelection.CopyFrom(items); I think the items in the selection tree will also be selected. The code you provided is just to filter the items you want to hide. It does not tell how you selected the items. Could you elaborate your question?