1 // This function is trying to print all of the current coordinate system coordinate system name 2 static void geom_list_name (tag_t group_tag) . 3 { . 4 // ask_member_list . 5 int COUNT = 0 ; . 6 tag_t List * = NULL; . 7 // ask_name . 8 char name [UF_OBJ_NAME_LEN + . 1 ]; . 9 // ask_type_and_subtype 10 int type = 0 ; . 11 int subtype = 0 ; 12 is UF_NCGROUP_ask_member_list (group_tag, & COUNT, &list); 13 UF_UI_open_listing_window(); 14 for (int i=0;i<count;i++) 15 { 16 UF_OBJ_ask_type_and_subtype(list[i],&type,&subtype); 17 if (type==UF_machining_geometry_grp_type && subtype==UF_mill_orient_subtype) 18 { 19 UF_OBJ_ask_name(list[i],name); 20 strcat_s(name,"\n"); 21 UF_UI_write_listing_window(name); 22 UF_UI_write_listing_window ( " \ n- " ); 23 is } 24 } 25 } 26 is // This function is attempting to print the current program name program group 27 static void programmer_list_name (tag_t group_tag) 28 { 29 // ask_member_list 30 int COUNT = 0 ; 31 is tag_t List * = NULL; 32 // ask_name 33 is char name [UF_OBJ_NAME_LEN + . 1 ]; 34 is // ask_type_and_subtype 35 int type=0; 36 int subtype=0; 37 UF_NCGROUP_ask_member_list(group_tag,&count,&list); 38 UF_UI_open_listing_window(); 39 for (int i=0;i<count;i++) 40 { 41 UF_OBJ_ask_type_and_subtype(list[i],&type,&subtype); 42 if (type==UF_machining_task_type && subtype==UF_mach_order_task_subtype) 43 { 44 UF_OBJ_ask_name(list[i],name); 45 strcat_s (name, " \ n- " ); 46 is UF_UI_write_listing_window (name); 47 UF_UI_write_listing_window ( " \ n- " ); 48 } 49 } 50 } 51 is // This function is a tool name Print all attempted tool 52 is static void machine_list_name (tag_t group_tag) 53 is { 54 is // ask_member_list 55 int COUNT = 0 ; 56 is tag_t List * = NULL; 57 is //ask_name 58 char name[UF_OBJ_NAME_LEN+1]; 59 //ask_type_and_subtype 60 int type=0; 61 int subtype=0; 62 UF_NCGROUP_ask_member_list(group_tag,&count,&list); 63 UF_UI_open_listing_window(); 64 for (int i=0;i<count;i++) 65 { 66 UF_OBJ_ask_type_and_subtype(list[i],&type,&subtype); 67 if(type == == UF_machining_tool_type && subtype UF_mach_tool_subtype) 68 { 69 UF_OBJ_ask_name (List [I], name); 70 strcat_s (name, " \ n- " ); 71 is UF_UI_write_listing_window (name); 72 UF_UI_write_listing_window ( " \ n- " ); 73 } 74 } 75 } 76 // this function is the name of the current process is to print all of the methods tried 77 static void method_list_name (tag_t group_tag) 78 { 79 //ask_member_list 80 int count=0; 81 tag_t *list=NULL; 82 //ask_name 83 char name[UF_OBJ_NAME_LEN+1]; 84 //ask_type_and_subtype 85 int type=0; 86 int subtype=0; 87 UF_NCGROUP_ask_member_list(group_tag,&count,&list); 88 UF_UI_open_listing_window(); 89 for (int i=0;i<count;i++) 90 { 91 UF_OBJ_ask_type_and_subtype(list[i],&type,&subtype); 92 if (type==UF_machining_mthd_type && subtype==UF_mach_mill_mthd_subtype) 93 { 94 UF_OBJ_ask_name(list[i],name); 95 strcat_s(name,"\n"); 96 UF_UI_write_listing_window(name); 97 UF_UI_write_listing_window("\n"); 98 } 99 } 100 } 101 extern DllExport void ufsta( char *param, int *returnCode, int rlen ) 102 { 103 /* Initialize the API environment */ 104 if( UF_CALL(UF_initialize()) ) 105 { 106 /* Failed to initialize */ 107 return; 108 } 109 110 /* TODO: Add your application code here */ 111 UF_initialize(); 112 //根 113 tag_t setup_tag=NULL_TAG; 114 tag_t geom_group = NULL_TAG; 115 tag_t mct_group = NULL_TAG; 1 16 tag_t mthd_group = NULL_TAG; 117 tag_t program_group = NULL_TAG; 1 18 UF_SETUP_ask_setup (& setup_tag); 119 // geometry attempts to 120 UF_SETUP_ask_geom_root (setup_tag, & geom_group); 121 // machine attempts to 122 UF_SETUP_ask_mct_root (setup_tag, & mct_group); 123 // method attempts to 124 UF_SETUP_ask_mthd_root (setup_tag, & mthd_group); 125 // program attempts 126 UF_SETUP_ask_program_root (setup_tag,&program_group); 127 //打印 128 geom_list_name(geom_group); 129 programmer_list_name(program_group); 130 machine_list_name(mct_group); 131 method_list_name(mthd_group); 132 133 UF_terminate(); 134 /* Terminate the API environment */ 135 UF_CALL(UF_terminate()); 136 }
UFUN function UF_SETUP UF_NCGROUP (overview of all program names in the CAM module Geometric processing method)
Guess you like
Origin www.cnblogs.com/zzyfym/p/12108176.html
Ranking