|
![]() |
Provides the same interface as Autodesk.Navisworks.Api.ApplicationParts.ApplicationAutomation but via Automation.
Calls made via this class eventually call methods on Autodesk.Navisworks.Api.ApplicationParts.ApplicationAutomation.
Namespace: Autodesk.Navisworks.Api.Automation
Assembly: Autodesk.Navisworks.Automation (in Autodesk.Navisworks.Automation.dll)
Syntax
Visual Basic |
---|
Public Class NavisworksApplication _ Implements IDisposable |
C# |
---|
public class NavisworksApplication : IDisposable |
Visual C++ |
---|
public ref class NavisworksApplication : IDisposable |
Remarks
This class provides the same interface as ApplicationAutomation but via Automation.
Calls made via this class eventually call methods on ApplicationAutomation.
Examples

Autodesk.Navisworks.Api.Automation.NavisworksApplication automationApplication = null; try { //Get Current Working directory string workingDir = System.IO.Directory.GetCurrentDirectory().TrimEnd('\\'); //create NavisworksApplication automation object automationApplication = new Autodesk.Navisworks.Api.Automation.NavisworksApplication(); //disable progress whilst we do this procedure automationApplication.DisableProgress(); //Open two AutoCAD files automationApplication.OpenFile(workingDir + "\\hello.dwg", workingDir + "\\world.dwg"); //Save the combination into a Navisworks file automationApplication.SaveFile(workingDir + "\\hello_world.nwd"); //Re-enable progress automationApplication.EnableProgress(); } catch (Autodesk.Navisworks.Api.Automation.AutomationException e) { //An error occurred, display it to the user System.Windows.Forms.MessageBox.Show("Error: " + e.Message); } catch (Autodesk.Navisworks.Api.Automation.AutomationDocumentFileException e) { //An error occurred, display it to the user System.Windows.Forms.MessageBox.Show("Error: " + e.Message); } finally { if (automationApplication != null) { automationApplication.Dispose(); automationApplication = null; } }