Message 1 of 13
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am attempting to get the IiLogicAutomation from an Addin im writing.
i get it like this:
public static class iLogicUtilities
{
private static string iLogicAddinGuid = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}";
private static IiLogicAutomation _iLogicAutomation = null;
public static IiLogicAutomation GetiLogicAutomation(Application app)
{
var addin =app.ApplicationAddIns.ItemById[(iLogicAddinGuid)];
try
{
if (_iLogicAutomation is null){
_iLogicAutomation = (IiLogicAutomation)addin.Automation;}
return _iLogicAutomation;
}
catch
{
return (IiLogicAutomation)addin.Automation;
}
}
}
unfortunately i get
Unable to cast COM object of type 'System.__ComObject' to interface type 'Autodesk.iLogic.Interfaces.IiLogicAutomation'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{91DF0977-6AF7-305B-A571-67AF76D7A4C9}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Does anyone have any idea how i can fix this?
Solved! Go to Solution.