Class KhungInfor (Không bắt buộc)
1 Thêm class KhungInfor.cs
Lưu mã sau dưới dạng tệp tin KhungInfor.cs
Code:
public class KhungInfor
{
public Curve Left { get; set; }
public Curve Right { get; set; }
public Curve Mid { get; set; }
public Curve Frame { get; set; }
public int Index { get; internal set; }
public DBText DBText { get; internal set; }
public Point3d Center { get; internal set; }
public Point3dCollection Coordinates { get; internal set; }
public ObjectId FrameId { get; internal set; }
public double Rotation { get; internal set; }
public Vector3d ViewDirection { get; internal set; }
}Mã code xoay Viewport
2 Xoay theo thông số khung.Rotation
Code:
if (rotate)
{
var khung = ks.FirstOrDefault(x => x.Center.Inside(cv.Coordinates()));
if (khung != null)
{
vp.TwistAngle += -khung.Rotation;
vp.ViewCenter = vp.ViewCenter.TransformBy(Matrix2d.Rotation(-khung.Rotation, Point2d.Origin));
}
}
vp.UpdateDisplay();---------------------------------------------------------------------------------------------
Mọi thông tin xin liên hệ Fanpage AutoLISP Thật là đơn giản!
Cảm ơn bạn đã theo dõi!


Không có nhận xét nào:
Đăng nhận xét