External component has thrown an exception error with Navisworks 2024 controls API

External component has thrown an exception error with Navisworks 2024 controls API

Jukka60
Participant Participant
2,388 Views
10 Replies
Message 1 of 11

External component has thrown an exception error with Navisworks 2024 controls API

Jukka60
Participant
Participant

Hi,

 

I have an "external component has thrown an exception" issue with Navisworks 2024 controls API. 

 

Autodesk.Navisworks.Api.Controls.ApplicationControl.ApplicationType = ApplicationType.SingleDocument

 

'------Exception is thrown here

 

ApplicationControl.Initialize()
Dim documentControl1 As DocumentControl = New DocumentControl()
documentControl1.SetAsMainDocument()

Same code is working fine from Navisworks 2018 to 2023. Has anyone managed to solve similar problem?

 

Thank you,

Jukka

Accepted solutions (1)
2,389 Views
10 Replies
Replies (10)
Message 2 of 11

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Jukka60 ,

 

We are already aware of this issue.
We have already raised the issue with the Navisworks engineering team. 
NW-59164 Issue in Navisworks 2024 SDK

I will get back to you when I get an update from the engineering team.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 3 of 11

alexisDVJML
Collaborator
Collaborator

Hi @naveen.kumar.t,

What is the process to access this issues list?

I just tried to click on this link, got MSFT authorization dialog and ended with:

alexisDVJML_0-1683030548382.png

 

 

One of the most confusing login message I ever seen 🤣

 

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
Message 4 of 11

clhicks9AZUF
Explorer
Explorer

I too am experiencing this issue. I hadn't posted yet as I was trying a bunch of things first to eliminate local configuration issues.  I've tried this on 2 separate systems with the same results: exception thrown when the Initialize method is called.

 

Navisworks seems to run fine on its own, the only issue for me is with automation

 

Systems: Windows 10 enterprise, Windows 10Pro

Navisworks Simulate 2024

Navisworks 2023 SDK from here: https://www.autodesk.com/developer-network/platform-technologies/navisworks

 

The examples that come with the SDK are failing as-is without modification when calling:

Autodesk.Navisworks.Api.Controls.ApplicationControl.Initialize();

 

There is one simple example "FileManipulation" that doesn't error as it is not calling Initialize.

 

Exception details:

System.Runtime.InteropServices.SEHException

 

StackTrace " at LcOwApplication.InitialiseApp(LcOwApplicationAppConfig* )\r\n at Autodesk.Navisworks.Internal.ApiImplementation.ApplicationImpl.InitialiseApi(ApplicationConfig config)\r\n at Autodesk.Navisworks.Api.Controls.ApplicationControl.InitializeImpl()\r\n at ControlsAndCOM.Program.XMain() in C:\\Program Files\\Autodesk\\Navisworks Simulate 2024\\api\\NET\\examples\\Basic Examples\\CSharp\\ControlsAndCOM\\Program.cs:line 69\r\n at ControlsAndCOM.Program.Main(String[] args) in C:\\Program Files\\Autodesk\\Navisworks Simulate 2024\\api\\NET\\examples\\Basic Examples\\CSharp\\ControlsAndCOM\\Program.cs:line 54"

 

TargetSite {Void LcOwApplication.InitialiseApp(LcOwApplicationAppConfig*)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

0 Likes
Message 5 of 11

clhicks9AZUF
Explorer
Explorer
I've rolled back to Navisworks 2023 and confirmed it gets past the SEHException when calling ApplicationControl.Initialize();
0 Likes
Message 6 of 11

naveen.kumar.t
Autodesk Support
Autodesk Support

I checked with the Navisworks Engineering team. The Engineering team said they have no updates.

The Engineering team is yet to analyze this issue.

@alexisDVJML  the link I shared will only accessed by Internal Autodesk members.

That's why you are getting an error message.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 7 of 11

alexisDVJML
Collaborator
Collaborator

Ok, Thanks, that clears my confusion 😉

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
0 Likes
Message 8 of 11

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Jukka60 ,

 

The Engineering team is able to reproduce the issue.

 

The issue will be fixed in next NW update (Navisworks 2024 Update 1). 

 

For now, the workaround is to add the installation directory of Navisworks to the path before calling Autodesk.Navisworks.Api.Controls.ApplicationControl.Initialize(); e.g. something like Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH") + ";" + nwInstallDir); where nwInstallDir has a value corresponding to where NW is installed.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 9 of 11

Jukka60
Participant
Participant

Hi Naveen,

 

Thank you for the information, workaround works fine.

0 Likes
Message 10 of 11

etick
Contributor
Contributor

Is this fixed now?

 

A path setting does not work for me in Windows 11, and does this work when users in an enterprise environment only have simple user rights?

 

Regards

 

Eddy

0 Likes
Message 11 of 11

etick
Contributor
Contributor

Ok set the path in the Windows settings and now get a new exception

 

at LcOwApplication.InitialiseApp(LcOwApplicationAppConfig* )
at Autodesk.Navisworks.Internal.ApiImplementation.ApplicationImpl.InitialiseApi(ApplicationConfig config)
at Autodesk.Navisworks.Api.Controls.ApplicationControl.InitializeImpl()
at MDIViewer.Program.XMain() in D:\SDK\Navisworks Manage 2024\NET\examples\Controls\Viewers\MDIViewer\Program.cs:line 77
at MDIViewer.Program.Main() in D:\SDK\Navisworks Manage 2024\NET\examples\Controls\Viewers\MDIViewer\Program.cs:line 49

 

this is in the original SDK sample viewer

0 Likes