public static void AddNewSymbolRec(this Database db, SymbolTableRecord newRec) { var symbolTableId = db.GetSymbolTableId(newRec.GetType()); using (var transaction = db.TransactionManager.StartTransaction()) { var symbolTable = (SymbolTable)transaction.GetObject(symbolTableId, OpenMode.ForWrite); symbolTable.Add(newRec); transaction.AddNewlyCreatedDBObject(newRec, true); transaction.Commit(); } }
AddNewSymbolRec(SymbolTableRecord newRec) { Debug.Assert(m_trans != null); ObjectId tblId = Utils.SymTbl.GetSymbolTableId(newRec.GetType(), m_db); SymbolTable tbl = (SymbolTable)m_trans.GetObject(tblId, OpenMode.ForWrite); Debug.Assert(tbl.Has(newRec.Name) == false); tbl.Add(newRec); m_trans.AddNewlyCreatedDBObject(newRec, true); }