|
![]() |
Named property with data value. Immutable.
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Visual Basic |
---|
Public Class DataProperty _ Inherits NativeHandle |
C# |
---|
public class DataProperty : NativeHandle |
Visual C++ |
---|
public ref class DataProperty : public NativeHandle |
Remarks
A named property with a data value, these are most commonly found as properties in a specific category (PropertyCategory) and can be accessed by the PropertyCategory.Properties collection.
More information on this topic can be found in Properties and Searching in the 'Developer guide'
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 IteratePropertyCategoryDataPropertys() { //create a list to store the category names StringBuilder output = new StringBuilder(); //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) { //iterate over the DataPropertys foreach (DataProperty dataProperty in category.Properties) { //add content for display output.Append(string.Format( "PropertyCategory: ({0} / {1}) DataProperty: CombinedName='{2}', Value='{3}'", category.DisplayName, category.Name, dataProperty.CombinedName, (dataProperty.Value == null ? "" : dataProperty.Value.ToString()))); } } } //output to the screen MessageBox.Show(output.ToString()); } }
Inheritance Hierarchy
System..::..Object
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..DataProperty
Autodesk.Navisworks.Api..::..NativeHandle
Autodesk.Navisworks.Api..::..DataProperty