Print tool name

1 #include <uf.h>
2 #include <uf_ui.h>
3 #include <uf_obj.h>
4 #include <uf_object_types.h>
5 #include <uf_ncgroup.h>
6 #include <uf_setup.h>
7 #include <uf_cam.h>
8 #include <uf_part.h>
9 #include <uf_ui_ont.h>
 1     UF_initialize();
 2     std::vector<tag_t>tool_tag;
 3     tag_t ObjectTag=NULL_TAG;
 4     int Type, SubType;
 5     UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_machining_tool_type, &ObjectTag);
 6     while (ObjectTag!=NULL_TAG)
 7     {
 8         UF_OBJ_ask_extended_type_and_subtype(ObjectTag,&Type,&SubType);
 9         if (Type==UF_machining_tool_type&&SubType==UF_mach_tool_subtype)
10         {
11             tool_tag.push_back(ObjectTag);
12         }
13         UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_machining_tool_type, &ObjectTag);
14     }
15     for (int i = 0; i < tool_tag.size(); i++)
16     {
17         char name[UF_OBJ_NAME_LEN];
18         UF_OBJ_ask_name(tool_tag[i],name);
19         print(name);        
20     }
21 
22 
23     UF_terminate();

 

Guess you like

Origin www.cnblogs.com/liuxiaoqing1/p/12741766.html