heidong2002 发表于 2010-5-22 00:01:00

请教版主一个基本概念

在autodesk c#.net的例题三中

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....这句注释掉,程序依然照常执行,那通过这句话来打开模型空间有什么用呢?

雪山飞狐_lzh 发表于 2010-5-22 19:54:00

没什么用,autodesk的示例代码一直都没什么改进,呵呵
页: [1]
查看完整版本: 请教版主一个基本概念