Message 1 of 11
iLogic Activation error
Not applicable
04-26-2013
12:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
When I deactivate iLogic using the API and reactivate, Inventor throw an error.
Here's the error:
Here's my code:
private void DeactivateAndActivateiLogicTest()
{
// Get Inventor application
Inventor.Application app = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application") as Inventor.Application;
// Get iLogic addin
Inventor.ApplicationAddIn iLogic = ItemByName(app.ApplicationAddIns, "iLogic");
if (iLogic != null)
{
// Deactivate iLogic addin
iLogic.Deactivate();
// Activate iLogic addin
iLogic.Activate();
}
}
private Inventor.ApplicationAddIn ItemByName(Inventor.ApplicationAddIns applicationAddIns, string displayName)
{
foreach (Inventor.ApplicationAddIn i in applicationAddIns)
{
if (i.DisplayName == displayName)
{
return i;
}
}
return null;
}
By the interface, it's impossible to deactivate the iLogic addin. Maybe I'm not supposed to deactivate it but the API allows me.
Someone have an explanation?
Pascal Langlais
