public void bx_OpenTamplate() { App.Document doc = App.Application.DocumentManager.MdiActiveDocument; if (doc == null) { return; } string strFileName = CheckLocalRepository.GetRepository(); App.DocumentCollection acDocMgr = App.Application.DocumentManager; if (System.IO.File.Exists(strFileName)) { //Для 2011 автокада #if acad2011 acDocMgr.Open(strFileName, false); #endif //Для 2012 и выше #if !acad2011 App.DocumentCollectionExtension.Open(acDocMgr, strFileName, false); #endif } else { acDocMgr.MdiActiveDocument.Editor. WriteMessage($"Файла репозитория { strFileName} не существует."); } }
public static void bn11009() { string strFileName = "e:\\grid.dwg"; AcadApp.DocumentCollection acDocMgr = AcadApp.Application.DocumentManager; if (System.IO.File.Exists(strFileName)) { acDocMgr.Open(strFileName, false); acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " + strFileName + " exist."); } else { acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " + strFileName + " does not exist."); } }