在autodesk c#.net的例题三中 [CommandMethod("test")] public void createCircle() { Circle circle; BlockTableRecord btr; BlockTable bt; Transaction trans; trans = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction(); circle = new Circle(new Point3d(10, 10, 0), Vector3d.ZAxis, 2); bt = (BlockTable)trans.GetObject(HostApplicationServices.WorkingDatabase.BlockTableId, OpenMode.ForRead); btr = (BlockTableRecord)trans.GetObject(HostApplicationServices.WorkingDatabase.CurrentSpaceId,OpenMode.ForWrite ); btr.AppendEntity(circle); trans.AddNewlyCreatedDBObject(circle, true); //and make sure the transaction knows about it! trans.Commit(); trans.Dispose(); } 把bt = (BlockTable)trans....这句注释掉,程序依然照常执行,那通过这句话来打开模型空间有什么用呢?
|