|
Document doc = Autodesk..ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Point3d point = new Point3d(0, 0, 0);//默认插入基点,坐标原点
string blockName = System.IO.Path.GetFileNameWithoutExtension(CDrawProgress.objDefaultTk._DwgPath);
Database db = new Database(false, true);
//打开文件
db.ReadDwgFile(CDrawProgress.objDefaultTk._DwgPath, System.IO.FileShare.Read, true, null);
db.CloseInput(true);
Database curdb = HostApplicationServices.WorkingDatabase;
以上为代码实现,标红色的那行代码,执行就报eFileNotFound。
该方法中CDrawProgress.objDefaultTk._DwgPath是一个变量,存的是要加载的DWG文件
|
|