[求助]CAD R旋转方法是怎么做的 在线等
<p>CAD R旋转方法是怎么做的,编程怎么编呀`~~高手帮下忙~~~我是新人~~</p><p>谢谢</p>
<p>在线等 Rotate都有哪些方法呀~</p> /// <summary>
/// 旋转的函数.
/// </summary>
/// <param name="ent"></param>
/// <param name="basePt"></param>
/// <param name="angle"></param>
public static void Rotate(Entity ent, Point3d basePt, Double angle)
{
if (angle != 0)
{
Matrix3d mt = Matrix3d.Rotation(angle, Vector3d.ZAxis, basePt);
ent.TransformBy(mt);
}
}
/// <summary>
/// 旋转的函数.
/// </summary>
/// <param name="id"></param>
/// <param name="basePt"></param>
/// <param name="angle"></param>
public static void Rotate(ObjectId id, Point3d basePt, Double angle)
{
Matrix3d mt = Matrix3d.Rotation(angle, Vector3d.ZAxis, basePt);
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
Entity ent = (Entity)trans.GetObject(id, OpenMode.ForWrite);
ent.TransformBy(mt);
trans.Commit();
}
}
<p>先收藏后来慢慢学习..</p>
页:
[1]