本帖最后由 chpmould 于 2010-12-18 14:25 编辑
- public void testLine()
- {
- Database db = HostApplicationServices.WorkingDatabase;
- using (Transaction ta = db.TransactionManager.StartTransaction())
- {
- BlockTable bt = (BlockTable)ta.GetObject(db.BlockTableId, OpenMode.ForRead);
- BlockTableRecord btr = (BlockTableRecord)ta.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
- Line ent = new Line(new Point3d(0, 0, 0), new Point3d(20, 10, 0));
- //请老师指点,如何获取这条线的角度
- btr.AppendEntity(ent);
- ta.AddNewlyCreatedDBObject(ent, true);
- ta.Commit();
- }
- }
|