Sets the IsHidden property on all instances of specified items.
Namespace: Autodesk.Navisworks.Api.DocumentParts
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Examples
CopyHide the unselected ModelItems
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Forms;
using System.Text;
using Autodesk.Navisworks.Api.Controls;
static public void HideUnselected()
{
ModelItemCollection hidden = new ModelItemCollection();
ModelItemCollection visible = new ModelItemCollection();
foreach (ModelItem item in Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems)
{
if (item.AncestorsAndSelf != null)
visible.AddRange(item.AncestorsAndSelf);
if (item.Descendants != null)
visible.AddRange(item.Descendants);
}
foreach (ModelItem toShow in visible)
{
if (toShow.Parent != null)
{
hidden.AddRange(toShow.Parent.Children);
}
}
foreach (ModelItem toShow in visible)
{
hidden.Remove(toShow);
}
Autodesk.Navisworks.Api.Application.ActiveDocument.Models.
SetHidden(hidden, true);
}
Exceptions
See Also