|
![]() |
Represents a reference to a saved item. Immutable.
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Visual Basic |
---|
Public Class SavedItemReference _ Inherits NativeHandle |
C# |
---|
public class SavedItemReference : NativeHandle |
Visual C++ |
---|
public ref class SavedItemReference : public NativeHandle |
Remarks
Used with Selection sets this is a safe way to ensure that when using a SavedItem being referenced still exists.
Examples

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() { //first check we have some data to test this with if (Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.RootItem.Children.Count > 0) { //get the first child item SavedItem item = Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.RootItem.Children[0]; //create the SavedItemReference SavedItemReference reference = Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.CreateReference(item); //check the resolved reference 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"); } //remove the SavedItem bool val = Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.Remove(item); //check resolved reference is no longer valid if (Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.ResolveReference(reference) == null) { MessageBox.Show("SavedItem no longer exists"); } } }
Inheritance Hierarchy
System..::..Object
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..SavedItemReference
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..SavedItemReference