可以通过BlockTable bt = (BlockTable)ts.GetObject(pdb.BlockTableId, OpenMode.ForRead); BlockTableRecord btr = (BlockTableRecord)ts.GetObject(bt[BlockTableRecord.PaperSpace], OpenMode.ForRead); BlockTableRecordEnumerator btret = btr.GetEnumerator(); while (btret.MoveNext()) { ObjectId objid = btret.Current; Entity ent = ts.GetObject(objid, OpenMode.ForWrite) as Entity; if (ent.GetType() == typeof(Line)) {来遍历直线,然后保存直线的EndPoint,StartPoint的X,Y,Z值(double)类型与数据库即可,下次使用时刻调出这些值,直接创建直线,然后插入块表中,提交事务 |
|