cad二次开发吧 关注:662贴子:1,409
  • 0回复贴,共1

旋转/放大/镜像/移动对象(objarx c#)

只看楼主收藏回复

public static void Move(Entity ent,Point3d ptStart,Point3d ptEnd)
        {
            ent.TransformBy(Matrix3d.Displacement(ptEnd - ptStart));
        }
        public static void Mirror(Entity ent, Line3d line)
        {
            ent.TransformBy(Matrix3d.Mirroring(line));
        }
        public static void Scale(Entity ent,Point3d center,float scaleAll)
        {
            ent.TransformBy(Matrix3d.Scaling(scaleAll,center));
        }
        public static void Rotate(Entity ent, Point3d center, double angle)
        {
           //new Vector3d(0, 0, 1)应该是用来标识基准平面的,这里指的是在XY平面内旋转
            ent.TransformBy(Matrix3d.Rotation(angle, new Vector3d(0, 0, 1), center));
        }


IP属地:四川1楼2008-03-15 19:43回复