快捷导航 上传作品

[c++] NX二次开发按类别选择对话框C++源码教程就上UG网

  [复制链接]
ug9.0发表于 2016-5-13 08:21:55 | 显示全部楼层 |阅读模式
学UG就上UG网:
按类别选择对话框函数在选择对象时提供了过滤功能,:UF_UI_select_with_class_dialog创建,用户只能选取某些规定的类别对象,对于选择的类型,用户是可以多重定义的。

按类别选择对话框C++源代码

按类别选择对话框C++源代码

按类别选择对象对话框C++源码:
  1. 头文件:
  2. #include <uf_modl.h>
  3. #include <uf_obj.h>

  4. /*选择子函数*/
  5.     static int select_filter_proc_fn(tag_t object, int type[3], void * user_data,
  6.         UF_UI_selection_p_t select)
  7.     {
  8.         if (object == NULL_TAG) return UF_UI_SEL_REJECT;
  9.         else return  UF_UI_SEL_ACCEPT;
  10.     }
  11.     static int select_init_proc(UF_UI_selection_p_t select, void * user_data)
  12.     {
  13.         int num_triples = 3;
  14.         UF_UI_mask_t mask_triples[] = { UF_point_type, UF_point_subtype, UF_UI_SEL_NOT_A_FEATURE,
  15.             UF_line_type, UF_line_normal_subtype, UF_UI_SEL_NOT_A_FEATURE,
  16.             UF_solid_type, UF_solid_body_subtype, UF_UI_SEL_FEATURE_BODY };
  17.         UF_UI_set_sel_mask(select, UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC, num_triples, mask_triples);
  18.         if ((UF_UI_set_sel_procs(select, select_filter_proc_fn, NULL, user_data)) == 0)
  19.             return UF_UI_SEL_SUCCESS;
  20.         else return UF_UI_SEL_FAILURE;
  21.     }
复制代码
按类别选择对话框函数:
  1.    /* TODO: Add your application code here */

  2.   
  3.     /*按类别选择对话框*/
  4.     char Cue[] = "孔子培训_按类别选择对话框";
  5.     char Title[] = "就上UG网学UG-www.9sug.com";
  6.     int Scope = UF_UI_SEL_SCOPE_NO_CHANGE;

  7.     int Response;
  8.     int count;
  9.     tag_t * Object;

复制代码
关键函数书写部分:
游客,如果您要查看本帖隐藏内容请回复
就上UG网淘宝直营店
回复

使用道具 评分 举报

您需要登录后才可以回帖 登录 | 注册UG网

本版积分规则