时间:2019-03-18 标签:c#autocadsetucszaxis
c# autocad set ucs z axis
my google-fu 在设置 autocad ucs z 轴方面很薄弱。我已经在网上看到许多通过 none 设置 z 轴来定义 ucs 的示例。我可以通过命令行键入 'ucs' 然后 'za' 并选择 2 个点来定义 z 轴来手动设置 z 轴。
我试过这个:
Align the UCS to an entity
没有按我的需要工作。我也尝试修改它,但我显然缺少一些 C# 知识来做这件事。任何帮助表示赞赏。
谢谢
这是一个扩展方法:
public static class EditorExtension
{
public static void SetZAxisUcs (this Editor ed, Point3d basePoint, Point3d positiveZaxisPoint)
{
Plane plane = new Plane(basePoint, basePoint.GetVectorTo(positiveZaxisPoint));
Matrix3d ucs = Matrix3d.PlaneToWorld(plane);
ed.CurrentUserCoordinateSystem = ucs;
}
}
my google-fu 在设置 autocad ucs z 轴方面很薄弱。我已经在网上看到许多通过 none 设置 z 轴来定义 ucs 的示例。我可以通过命令行键入 'ucs' 然后 'za' 并选择 2 个点来定义 z 轴来手动设置 z 轴。
我试过这个: Align the UCS to an entity
没有按我的需要工作。我也尝试修改它,但我显然缺少一些 C# 知识来做这件事。任何帮助表示赞赏。
谢谢
这是一个扩展方法:
public static class EditorExtension
{
public static void SetZAxisUcs (this Editor ed, Point3d basePoint, Point3d positiveZaxisPoint)
{
Plane plane = new Plane(basePoint, basePoint.GetVectorTo(positiveZaxisPoint));
Matrix3d ucs = Matrix3d.PlaneToWorld(plane);
ed.CurrentUserCoordinateSystem = ucs;
}
}