|
![]() |
A collection of PropertyCategory objects.
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Visual Basic |
---|
Public Class PropertyCategoryCollection _ Inherits NativeHandle _ Implements IEnumerable(Of PropertyCategory), IEnumerable |
C# |
---|
public class PropertyCategoryCollection : NativeHandle, IEnumerable<PropertyCategory>, IEnumerable |
Visual C++ |
---|
public ref class PropertyCategoryCollection : public NativeHandle, IEnumerable<PropertyCategory^>, IEnumerable |
Remarks
The PropertyCategory class represents a group of properties, all of which have a common category. Instances of the class are found in ModelItem.PropertyCategories which is an instance of the collection class PropertyCategoryCollection.
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 IteratePropertyCategories() { //create a list to store the category names List<string> uniqueCategories = new List<string>(); //check there is a valid ActiveDocument if (Autodesk.Navisworks.Api.Application.ActiveDocument != null && !Autodesk.Navisworks.Api.Application.ActiveDocument.IsClear) { //iterate the ModelItems in the current selection foreach (ModelItem item in Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems) { //iterate the item's PropertyCategory entries foreach (PropertyCategory category in item.PropertyCategories) { string text = string.Format("{0} / {1}", category.DisplayName, category.Name); //check name isnt already in the list if (!uniqueCategories.Contains(text)) { //add to the list uniqueCategories.Add(text); } } } //build a display string StringBuilder output = new StringBuilder(); foreach (string s in uniqueCategories) output.AppendLine(s); //output to the screen MessageBox.Show(output.ToString()); } }
Inheritance Hierarchy
System..::..Object
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..PropertyCategoryCollection
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..PropertyCategoryCollection