Message 1 of 3
HSM-API from Standalone-EXE: Library not registered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
With the following snippet I'm trying to access HSM API:
#region only in Standalone-EXE
var invAppType = Type.GetTypeFromProgID("Inventor.Application");
var invApplication = (Application)Activator.CreateInstance(invAppType);
invApplication.Documents.Open("Path\\to\\HSM-Part.ipt");
#endregion
// the following works inside Inventor-Addin, but not in Standalone EXE
var hsmAddin = invApplication.ApplicationAddIns.ItemById["{749E667C-2560-416A-A5E7-68B96FF997B1}"];
var hsmApi = (InventorHSMAddinAPI)hsmAddin.Automation;
As the snippet says: the last two lines work as expected in an Inventor-Addin. But running this from a Standalone-EXE, I get an Exception:
Library not registered. (Exception of HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
Is there missing a dll? Or what's the problem?