选择一个组件,在屏幕中间显示组件的定位点信息,其代码如下:
/// <summary>
/// 在屏幕中显示组件定位点的信息
/// </summary>
/// <param name="component"></param>
public static void DisplayPosition(Component component)
{
Point3d point3D = new Point3d();
Matrix3x3 matrix3X3 = new Matrix3x3();
component.GetPosition(out point3D, out matrix3X3);
#region 在屏幕中心点处显示轴向
uFDisp.Refresh();
NXOpen.View workView = theSession.Parts.Work.Views.WorkView;
Point3d absolutePoint3D = workView.AbsoluteOrigin;
double[] coord = new double[3] { absolutePoint3D.X, absolutePoint3D.Y, absolutePoint3D.Z };