|
![]() |
Details some of the classes that developers will quite often come across. All of these are found under the root namespace of Autodesk.Navisworks.Api.
Application
The Application singleton has only static properties and cannot be instantiated directly. The key properties are:
-
Documents – Instances of the Document class for each document open in the application.
-
ActiveDocument – the document currently active in the application. Instance of the Document class.
-
MainDocument – the main Navisworks document. Instance of the Document class, may be the same reference as ActiveDocument. This is the same object throughout the runtime of the Navisworks application.
-
Gui – Provides information about the Gui of the application which is hosting the API. Implements the IApplicationGui interface.
Document
The Document class corresponds to the content of an .NWC/.NWD/.NWF file with methods, properties and events that apply to the document as a whole. The rest of the document is divided into self contained 'Autodesk.Navisworks.Api.DocumentParts'. This makes the Document structure easier to follow with a common structure that all parts follow.
DocumentParts
All Autodesk.Navisworks.Api.DocumentParts are defined in a separate namespace Autodesk.Navisworks.Api.DocumentParts and appear in the API only as properties of a Document.
Autodesk.Navisworks.Api.DocumentParts class instances are intended to be used directly (for example, for the DocumentCurrentSelection class, document.CurrentSelection. DocumentCurrentSelection..::..Clear) and have a common structure with direct access to read only values. Users can call copying methods for arbitrary editing with convenience methods for common edits. Events are raised before and after changes are made to Autodesk.Navisworks.Api.DocumentParts.
DocumentModels
The DocumentModels class represents the collection of Model instances contained in a Document. It is accessed by the Models property of the Document class.
Model
The Model class represents a loaded model within the model hierarchy. Models have constituent parts which are instances of ModelItem.
ModelItem
The ModelItem class represents an instance in the Model hierarchy. ModelItem instances can be made up from other ModelItem instances or can contain Geometry. Instances of the class can also correspond to another Model which is indicated by the 'HasModel' property and defined by the 'Model' property.
NativeHandle
NativeHandle is the common base class for classes which act as a managed handle to an implementation in native, unmanaged code. Classes derived from this base class are disposable by both the API client and Navisworks (for example if the end user closes the document). To this end an 'IsDisposed' property is provided to test whether the object is valid.
![]() |
---|
As there may be multiple NativeHandle objects referring to the same data, the Equals/== methods are overridden. |
Instances of classes derived from NativeHandle are writable when created by the developer but are read-only when exposed by part of the document as a property. There is an 'IsReadOnly' property provided on this class. Access to data stored in documents is always read only; users should use the Autodesk.Navisworks.Api.DocumentParts classes to edit the document.