Autocad Ver:2012.My code:
namespace testCADOpen
{
public class Class1
{
[CommandMethod("openfile")]
public void openFile()
{
DocumentCollection acDocMgr = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;
string strFileName = @"E:\test.dwg";
if (File.Exists(strFileName))
{
acDocMgr.Open(strFileName, false);
}
}
}
}
triggle the err message when debug in visual studio.(1.start vs,2 start debug ,3 netload testCADOpen.dll 4 openfile, Err)
It's no problem when netload the dll from Auocad directly.(1. start AutoCAD ,2 netload testCADOpen.dll 3 openfile, Ok)