|
![]() |
Collection of SavedItems that stores the children
of a GroupItem.
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Visual Basic |
---|
Public Class SavedItemCollection _ Implements IList(Of SavedItem), ICollection(Of SavedItem), _ IEnumerable(Of SavedItem), IEnumerable |
C# |
---|
public class SavedItemCollection : IList<SavedItem>, ICollection<SavedItem>, IEnumerable<SavedItem>, IEnumerable |
Visual C++ |
---|
public ref class SavedItemCollection : IList<SavedItem^>, ICollection<SavedItem^>, IEnumerable<SavedItem^>, IEnumerable |
Remarks
This class represents a collection of SavedItems and appears in the various classes relation to SelectionSets.
This class also appears in various DocumentSelectionSets methods as well as GroupItem
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 string WriteSelectionSetContent(SavedItem item, string label, string lineText) { //set the output string output = lineText + "+ " + label + "\n"; //See if this SavedItem is a GroupItem if (item.IsGroup) { //Indent the lines below this item lineText += " "; //iterate the children and output foreach (SavedItem childItem in ((GroupItem)item).Children) { output += WriteSelectionSetContent(childItem, childItem.DisplayName, lineText); } } //return the node information return output; } /// <summary> /// Outputs to a message box the structure of the selection sets /// </summary> static public void ListSelectionSets() { //build output string for display string output = WriteSelectionSetContent( Autodesk.Navisworks.Api.Application.ActiveDocument.SelectionSets.RootItem, Autodesk.Navisworks.Api.Application.ActiveDocument.Title, ""); //output in a message box MessageBox.Show(output); }