NX/UG二次开发—分析—测量面的面积的两种方法介绍

第一种方法(C#):

    public static double GetFaceArea(Tag t_face)
    {
        Face face = (Face)theNXManager.GetTaggedObject(t_face);
        NXOpen.Part workPart = theSession.Parts.Work;
        NXOpen.MeasureFaces measureFace1;

        NXOpen.IParameterizedSurface[] faceArea = new NXOpen.IParameterizedSurface[1];
        faceArea[0] = face;
        
        NXOpen.UnitCollection uniCol = workPart.UnitCollection;
        NXOpen.Unit[] uniList = uniCol.ToArray();
        Unit unit1 = uniList[0];
        measureFace1 = workPart.MeasureManager.NewFaceProperties(unit1, unit1, 0.2, faceArea);
        double dis = measureFace1.Area;

        return dis;
    }

第二种方法,导出函数从libgeom.dll中导出?MEASURE_calculate_area_of_faces@@YAHHPEAINPEAN1@Z测量多个面(C++)

typedef int(*MEASURE_calculate_area_of_faces) (int 个数, unsigned int *面的tag指针, double 公差, double *面的面积, double *面的估计误差);

测量单个面使用?MEASURE_ask_face_area@@YANIN@Z

上一篇:人脸聚类框架(Face Cluster Framework)


下一篇:NX二次开发-BlockUI选择面控件设置选择规格->SetFaceRules(1)及设置单选多选