Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here's the code...
private void Test1()
{
AcadApplication acadApp; // get a running instance of AutoCAD, or start one:
try
{
acadApp = (AcadApplication) Marshal.GetActiveObject("AutoCAD.Application");
}
catch ( Exception e )
{
acadApp = new AcadApplication();
}
string sVer = acadApp.Version; // This gives me sVer = "23.1s (LMS Tech)"
AxDbDocument dbxDoc = (AxDbDocument) acadApp.GetInterfaceObject("AxDbDocument.23.1s");
dbxDoc.Open(@"D:\Temp\CSHARP.DWG", string.Empty);
}
...GetInterfaceObject fails, with or without the last "s". Here's the error:
Name Value Type
| -2147221005 | int | ||
| Message | "Problem in loading application" | string |
See also the attached image (image insertion in the post does not work).
TIA
Solved! Go to Solution.