|
![]() |
The Navisworks .NET API is made up of different assemblies that contain a wide range of classes, structures, methods, and events that provide access to objects in a model file or the Navisworks application. Each assembly defines different namespaces which are used to organize the components of the libraries based on functionality.
Assemblies of the Navisworks .NET API
The three main assemblies of the Navisworks .NET API that you will frequently use are:
-
Autodesk.Navisworks.Api.dll. This is the core API, use when working with Plug-ins or with the Controls API.
-
Autodesk.Navisworks.Automation.dll. Use when working with Automation to drive Navisworks.
-
Autodesk.Navisworks.Controls.dll. Use when requiring GUI Controls or access to Navisworks documents within third party applications.
There is also 'Autodesk.Navisworks.ComAPI.dll' and 'Autodesk.Navisworks.Interop.ComApi.dll', which provides interaction with the older COM API.
Using the assemblies
Before classes, structures, methods, and events found in one of the Navisworks .NET API related assemblies can be used, you must reference the assembly from a project. After an assembly is referenced from a project, you can utilize the namespaces and the components in the assembly file in your project.
Once a Navisworks .NET API assembly is referenced, you must set the Copy Local property of the referenced assembly to false. The Copy Local property determines if Microsoft Visual Studio creates a copy of the referenced assemblies and places them in the same directory as the assembly file of the project when it is built. These referenced assemblies already ship with Navisworks, and are installed in the GAC. Creating copies of referenced assemblies may cause unexpected results when you load your assembly in Navisworks.
Location of Navisworks .NET API assemblies
The Navisworks .NET API assemblies can be typically found wherever the user has installed Navisworks, for example '<drive>:\Program Files\Autodesk\Navisworks <Product> 2015'.
Core API
The namespaces used for all the classes are to be found under the root namespace of Autodesk.Navisworks.Api and the entire representation of the API follows the 'Application, Document, View' architecture.
![]() |
---|
The API has been written so that it should not be possible to cause corruption or a low level crash using the API. However, exceptions can be thrown calling certain functions in the API and it is up to the developer to ensure that all relevant exceptions are caught. If the exception is not caught, Navisworks will generate a 'Customer Error Report' for the error and close the application. |
Automation API
The automation API is contained under the namespace Autodesk.Navisworks.Api.Automation and is used for all aspects of using Navisworks through Automation. The class NavisworksApplication contains several methods for starting/showing/hiding/closing Navisworks; opening /saving files; and invoking plug-ins.
Controls API
The controls API is found under the namespace Autodesk.Navisworks.Api.Controls and contains controls that can optionally be used in Microsoft Visual Studio's design studio. These controls include a document control for accessing Navisworks document content and a view control for viewing Navisworks documents using a document control.
![]() |
---|
The Controls assembly is only intended for use in standalone applications and should not be used by Plug-ins. |
COM API
The COM API can be accessed via .NET using the Autodesk.Navisworks.ComApi.dll assembly which is shipped with Navisworks. The ComApiBridge class gives developers access to the root COM interfaces.
A comparison between the COM API and the .NET API is illustrated here.