/// <summary>/// 将数据以表格形式插入图形/// </summary>/// <param name="db"></param>/// <param name="data"></param>/// <param name="position"></param>private static void InsertEntity(Entity entity){try{Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.CurrentDocument;Database db = Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;using (DocumentLock docLock = doc.LockDocument())using (Transaction trans = db.TransactionManager.StartTransaction()){BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead);BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);//插入实体btr.AppendEntity(entity);trans.AddNewlyCreatedDBObject(entity, true);trans.Commit();}}catch (Exception ex){throw ex;}}