【问题标题】:How can I label a line in NX Open C#?如何在 NX Open C# 中标记一行?
【发布时间】:2021-07-11 23:46:40
【问题描述】:

如何使用编码标记这些行?

我已经弄清楚如何使用此代码识别和计算存在多少行:

using NXOpen;

using System;

public class FailedRegionCounting
{
    public static void Main()
    {

        Session theSession=Session.GetSession();
        Part workpart=theSession.Parts.Work;
 
        int numLine = 0;

        foreach (NXOpen.Curve tempFeat in workpart.Curves)

        {
            string name = tempFeat.Name;
            string a = "Line";           

            if (name.Contains(a))
            {
                numLine = numLine + 1;
            }    
        }
        Guide.InfoWriteLine("This analysis has " + numLine + " of Lines.");
    }
}

不过,我想了解如何在 NX 上标记这些线条。

这在某种程度上是我想要的结果:

【问题讨论】:

    标签: c# .net label nomachine-nx nxopen


    【解决方案1】:
    1. 您可以使用 PMI 注释来实现这一点。

    2. 如果你想显示临时名称,那么有一些函数可以为曲线创建临时名称。

       UFObj.DispProps props = new UFObj.DispProps();
       props.color = 186;
       double[] loc = {rcpPoint.X+5, rcpPoint.Y+5, rcpPoint.Z+5};
       theUFSession.Disp.DisplayTemporaryText(
           Tag.Null, UFDisp.ViewType.UseWorkView,
           inx.ToString(), loc, UFDisp.TextRef.Middlecenter, ref props, 10.0, 1);
      

    【讨论】:

      猜你喜欢
      • 2021-09-16
      • 1970-01-01
      • 2022-07-25
      • 1970-01-01
      • 1970-01-01
      • 2020-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多