Naveen Kumar

Navisworks 2024 SDK is posted

By Naveen Kumar

Navisworks 2024 SDK has been posted on ADNOpen: 

https://www.autodesk.com/developer-network/platform-technologies/navisworks

Navisworks 2024 is built against .NET Framework 4.8, which means the application with NET API supports .NET Framework 4.8 and above. The program will need to be compiled by Visual Studio 2022 and .NET Framework 4.8 and above.

In Navisworks 2024 API, We have found an issue of .NET control application.

Issue Description: Autodesk.Navisworks.Api.Controls.ApplicationControl.Initialize() will throw an exception: "External Component has thrown an exception".

GIF

Solution: This issue is scheduled to be fixed in future update.

For now, the workaround is to add the installation directory of Navisworks to the path before calling Autodesk.Navisworks.Api.Controls.ApplicationControl.Initialize(); 

(i.e) Environment.SetEnvironmentVariable("PATH",Environment.GetEnvironmentVariable("PATH")+ ";"+nwInstallDir); 

where nwInstallDir has a value corresponding to where NW is installed.

Your sample code will look like this

 static void XMain()
 {
   //Set Environment variable
   string nwInstallDir = @"C:\Program Files\Autodesk\Navisworks Manage 2024";
   Environment.SetEnvironmentVariable("PATH",
                 Environment.GetEnvironmentVariable("PATH")+";"+nwInstallDir);
        
   //Set to single document mode
   Autodesk.Navisworks.Api.Controls.ApplicationControl.ApplicationType=ApplicationType.SingleDocument;

   //Initialise the api
   Autodesk.Navisworks.Api.Controls.ApplicationControl.Initialize();

   Application.EnableVisualStyles();
   Application.SetCompatibleTextRenderingDefault(false);
   Application.Run(new Viewer());

   //Finish use of the API.
   Autodesk.Navisworks.Api.Controls.ApplicationControl.Terminate();
 }

10/04/2022

10/03/2022

05/04/2022

November 2023

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Autodesk Blogs

Share