创建文字必须先将文档进行锁定;
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
DocumentLock dl =doc.LockDocument();
//需要开启一个事务
Transaction tr = doc.TransactionManager.StartTransaction();
//修改文档内容,创建文字等操作
tr.Commit();
dl.Dispose();