- public bool GetBlockDefFromFile(string filename, bool over)
- {
- try
- {
- FileInfo fi = new FileInfo(filename);
- string blkdefname = fi.Name;
- if (blkdefname.Contains("."))
- {
- blkdefname = blkdefname.Substring(0, blkdefname.LastIndexOf('.'));
- }
- bool has = m_BlockTable.Has(blkdefname);
- if ((has && over) || !has)
- {
- Database db = new Database();
- db.ReadDwgFile(filename, FileShare.Read, true, null);
- m_Database.Insert(BlockTableRecord.ModelSpace, blkdefname, db, false);
- }
- return true;
- }
- catch
- { }
- return false;
- }
|