Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Close Navisworks through API

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
sanderobdeijn
1387 Views, 3 Replies

Close Navisworks through API

I found that you can start navisworks with automation and start a plugin. Is it also possible to close Navisworks through the api.

3 REPLIES 3
Message 2 of 4

Hi,

you can just dispose the instance of the automation application. e.g. This below code is taken from the SDK sample api\NET\examples\Automation\CallExaminer

NavisworksApplication navisworksApplication = null;
try
{
// Start Navisworks
navisworksApplication = new NavisworksApplication();

//Call the Examiner Plugin using the arguments passed to this exe
navisworksApplication.ExecuteAddInPlugin("Examiner.Examiner.ADSK", args);
}
catch (InvalidOperationException e)
{
Console.WriteLine("InvalidOperationException: " + e.Message);
}
catch (ArgumentException e)
{
Console.WriteLine("ArgumentException: " + e.Message);
}
finally
{
//Close Navisworks
if (navisworksApplication != null)
{
navisworksApplication.Dispose();
}
}

Message 3 of 4

Well I enabled the stayopen option in automation. The application should stay open most of the time. But sometime I would like to close it. But at this moment the automation instance is already disposed.

Message 4 of 4

Hi,

The StayOpen tells the Navisworks instance not to close even the application disposes the instance. I am afraid you have to find the process and kill it if you set this StayOpen.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report