1 #include <uf.h>
 2 #include <uf_ui.h>
 3 
 4 UF_initialize();
 5 
 6 
 7 //按类选择对话框
 8 char sCue[] = "按类选择对话框";
 9 char sTitle[] = "按类选择对话框";
10 int iScope = UF_UI_SEL_SCOPE_WORK_PART;
11 int iResponse;
12 int iCount;
13 tag_t* atObject;
14 UF_UI_select_with_class_dialog(sCue, sTitle, iScope, NULL, NULL, &iResponse, &iCount, &atObject);
15 
16 
17 UF_terminate();
18 
19 Caesar卢尚宇
20 2019年7月1日

NX二次开发-UFUN按类选择对话框UF_UI_select_with_class_dialog(多选对象)

 

2021年2月23日

加类型过滤补充

#include <uf.h>
#include <uf_ui.h>
#include <uf_disp.h>
#include <uf_obj.h>


static int init_proc(UF_UI_selection_p_t select, void* user_data)
{
    int errorCode = 0;
    int num_triples = 1;
    UF_UI_mask_t mask_triples[1] = { {UF_face_type, 0, 0}//定义选择面类型
    };
    errorCode = UF_UI_set_sel_mask(select, 
        UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,
        num_triples,
        mask_triples);
    if (errorCode == 0)
    {
        return UF_UI_SEL_SUCCESS;
    }
    else
    {
        return UF_UI_SEL_FAILURE;
    }
}



UF_initialize();

//按类选择对话框
char sCue[] = "按类选择对话框";
char sTitle[] = "按类选择对话框";
int iScope = UF_UI_SEL_SCOPE_WORK_PART;
int iResponse;
int iCount;
tag_t* atObject;
UF_UI_select_with_class_dialog(sCue, sTitle, iScope, init_proc, NULL, &iResponse, &iCount, &atObject);
if (iResponse == UF_UI_OK && iCount > 0)//网友震动哥哥指出问题,此处原来是写cout的,是我写错了,正确应该写iCount 2021年6月20日
{
    for (int i = 0; i < iCount; i++)
    {
        //取消高亮
        UF_DISP_set_highlight(atObject[i], 0);

        //设置颜色
        UF_OBJ_set_color(atObject[i], 186);
    }

    UF_free(atObject);
}

UF_terminate();




Caesar卢尚宇
2021年2月23日

NX二次开发-UFUN按类选择对话框UF_UI_select_with_class_dialog(多选对象)

 

相关文章:

  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案