zoukankan      html  css  js  c++  java
  • NX CAM二次开发-UF_CAMBND_append_bnd_from_curve指定部件边界

    NX9+VS2012
    
    #include <uf.h>
    #include <uf_ui.h>
    #include <uf_ui_ont.h>
    #include <uf_cambnd.h>
    
    
    UF_initialize();
    
    //获取当前加工导航器选中的对象数量和TAG
    int count = 0;
    tag_t* objects = NULL_TAG;
    UF_UI_ONT_ask_selected_nodes(&count, &objects);
    
    for (int i = 0; i < count; i++)
    {
        tag_t operTag = objects[0];
    
        int edgeCount=vEdgeTags.size();
        tag_t curves[1000];
        for (int i=0; i<edgeCount; i++)
        {
            if (i<1000)
                curves[i]=vEdgeTags[i];
        }
        //指定部件边界
        UF_CAMBND_boundary_data_t boundary_data;
        boundary_data.boundary_type=UF_CAM_boundary_type_closed;
        boundary_data.plane_type=1;
        boundary_data.origin[0]=0;
        boundary_data.origin[1]=0;
        boundary_data.origin[2]=0;
        boundary_data.matrix[0]=1;
        boundary_data.matrix[1]=0;
        boundary_data.matrix[2]=0;
        boundary_data.matrix[3]=0;
        boundary_data.matrix[4]=1;
        boundary_data.matrix[5]=0;
        boundary_data.matrix[6]=0;
        boundary_data.matrix[7]=0;
        boundary_data.matrix[8]=1;
        boundary_data.material_side=UF_CAM_material_side_in_left;
        boundary_data.ignore_holes=0;
        boundary_data.ignore_islands=0;
        boundary_data.ignore_chamfers=0;
        boundary_data.app_data=NULL;
        UF_CAMBND_append_bnd_from_curve(operTag, UF_CAM_part, edgeCount, curves, &boundary_data, NULL);
    }
    
    //释放
    UF_free(objects);
    
    UF_terminate();
    
    Caesar卢尚宇
    2020年5月23日

    作者: 阿飞

    出处: https://www.cnblogs.com/nxopen2018/>

    关于作者:......

    如有问题, 可在底部(留言)咨询.

  • 相关阅读:
    88. Merge Sorted Array
    87. Scramble String
    86. Partition List
    85. Maximal Rectangle
    84. Largest Rectangle in Histogram
    83. Remove Duplicates from Sorted List
    82. Remove Duplicates from Sorted List II
    81. Search in Rotated Sorted Array II
    80. Remove Duplicates from Sorted Array II
    计算几何——点线关系(叉积)poj2318
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/12944711.html
Copyright © 2011-2022 走看看