如何对自己所画的内容进行操作
本帖最后由 iamygp 于 2012-5-28 12:57 编辑现在有如下程序:
public void CreateCircleLine()
{
// Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
BlockTable bt = (BlockTable)(trans.GetObject(db.BlockTableId, OpenMode.ForRead));
BlockTableRecord btr =(BlockTableRecord)trans.GetObject(bt, OpenMode.ForWrite);
Point3d center = new Point3d(10, 10, 0);
Circle circle = new Circle(center, Vector3d.ZAxis, 10.0);
circle.ColorIndex = 1;
btr.AppendEntity(circle);
Line line1 = new Line(Point3d.Origin, new Point3d(10, 15, 0));
btr.AppendEntity(line1);
Line line2 = new Line(Point3d(100,145,0), new Point3d(120, 135, 0));
btr.AppendEntity(line2);
trans.AddNewlyCreatedDBObject(circle,true);
trans.AddNewlyCreatedDBObject(line1, true);
trans.AddNewlyCreatedDBObject(line2, true);
trans.Commit();
}
}
如何对自己创建的线及圆创建一个选择集,然后再进行移动操作啊!恳请各位高手帮帮忙啊!
public virtual void TransformBy(Autodesk.AutoCAD.Geometry.Matrix3d transform)
Autodesk.AutoCAD.DatabaseServices.Entity 的成员
页:
[1]