I was trying to load AutoCAD 2015 from .Net process so that I can send commands to the document to create/modify blocks.
I tried both of these approaches but none of them seems to work.
1st approach:
AcadApplication app = new AcadApplication();
app.Visible = true;
2nd approach:
var t = Type.GetTypeFromProgID("AutoCAD.Application", true);
dynamic obj = Activator.CreateInstance(t, true);
In both of the cases I am getting COM exception. Any help?
It's not a duplicate as mentioned in comments, I have tried both approaches mentioned in here.
COM exception -
Retrieving the COM class factory for component with CLSID {0B628DE4-07AD-4284-81CA-5B439F67C5E6} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).