1 #include <uf.h> 2 #include <uf_ui.h> 3 4 5 static int select_filter_proc_fn(tag_t object, int type[3], void* user_data, UF_UI_selection_p_t select) 6 { 7 if (object == NULL) 8 { 9 return UF_UI_SEL_REJECT; 10 } 11 else 12 { 13 return UF_UI_SEL_ACCEPT; 14 } 15 } 16 . 17 static int init_proc (UF_UI_selection_p_t SELECT , void * the user_data) 18 is { . 19 int num_triples = . 3 ; // optional number of types of 20 is UF_UI_mask_t mask_triples [] = 21 is {UF_point_type, UF_point_subtype, UF_UI_SEL_NOT_A_FEATURE, 22 is UF_line_type, UF_line_normal_subtype, UF_UI_SEL_NOT_A_FEATURE, 23 is UF_solid_type, UF_solid_body_subtype, UF_UI_SEL_FEATURE_BODY 24 }; // selectable object types 25 UF_UI_set_sel_mask ( SELECT, UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC, num_triples, mask_triples); 26 if ((UF_UI_set_sel_procs(select, select_filter_proc_fn, NULL, user_data)) == 0) 27 { 28 return UF_UI_SEL_SUCCESS; 29 } 30 else 31 { 32 return UF_UI_SEL_FAILURE; 33 } 34 } 35 36 37 38 39 40 41 UF_initialize(); 42 43 //单对象选择对话框 44 char sCue[] = "Single Object selection dialog " ; 45 char stitle [] = " single object selection dialog " ; 46 is int the iScope = UF_UI_SEL_SCOPE_NO_CHANGE; 47 int IResponse; 48 tag_t TObject; 49 tag_t Tview; 50 Double adCursor [ . 3 ]; 51 is UF_UI_select_with_single_dialog (sCue , stitle, the iScope, init_proc, NULL, & IResponse, & TObject, adCursor, & Tview); 52 is 53 is UF_terminate (); 54 is 55 Caesar Lushang Yu 56 is July 1, 2019
NX secondary development -UFUN single object selection dialog UF_UI_select_with_single_dialog
Guess you like
Origin www.cnblogs.com/nxopen2018/p/11116342.html
Recommended
Ranking