版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zhengxiaotaozz/article/details/85088523
创建文字必须先将文档进行锁定;
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
DocumentLock dl =doc.LockDocument();
//需要开启一个事务
Transaction tr = doc.TransactionManager.StartTransaction();
//修改文档内容,创建文字等操作
tr.Commit();
dl.Dispose();