In my Autocad .NET program I want to get a running instance of Navisworks and execute a Navisworks plugin. I have Navisworks running, but when I execute my Autocad .NET command, getting the running instance works very poorly.
Autodesk.Navisworks.Api.Automation.NavisworksApplication.TryGetRunningInstance()
never works.
Autodesk.Navisworks.Api.Automation.NavisworksApplication.GetRunningInstance()
works only the first time I execute the Autocad .NET command, even though Navisworks continues to run normally.
Any ideas / experience on this?
Has ANYONE solved this? I am writing in Jan 2016 for NW Simulate 2013!!!! I have the same issue. - it runs once, but never again (it returns null) until you restart NW Simulate (roamer.exe) and again, it works only the first time. Now I'm using the VBA COM object. It was working last month, and one weekend later - it only runs the furst time.
After much digging, there is an entry in the ROT table like !{_insert_class_guid_here} - a microsoft ActiveX thing that heklps you grab the running instance. All apps run there, like Excel and keep an entry in there even after you r routine exits or the object is set to null. I cannot use the .quit (or equiv) because... I don't want it to quit. HOWEVER - the ROT entry is removed after the VBA COM component is completed running. This shoudl not be. A full uninstall-reinstall does NOT fix this. Neither does a repair. Many machines are "broken". Many are not - same company installs.
Anyone?
it works very well
in .net Api
it looks like this
using (var app = Autodesk.Navisworks.Api.Automation.NavisworksApplication.GetRunningInstance())
{
//your logic
app.StayOpen();
}
Yes, has worked for me like that in versions 2011-2021. But it stopped working in NavisWorks version 2022.
Any ideas how to make it work in version 2022?