Returns a reference to a saved item.
Namespace: Autodesk.Navisworks.Api.DocumentParts
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Examples
CopyUsing the SavedItemReference class
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 TestSavedItemReference()
{
if (Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.RootItem.Children.Count > 0)
{
SavedItem item = Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.RootItem.Children[0];
SavedItemReference reference =
Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.CreateReference(item);
if (Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.ResolveReference(reference)
== Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.RootItem.Children[0])
{
MessageBox.Show("resolved item matches the first child item");
}
bool val = Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.Remove(item);
if (Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.ResolveReference(reference)
== null)
{
MessageBox.Show("SavedItem no longer exists");
}
}
}
Exceptions
See Also