1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_disp.h> 5 #include <uf_obj.h> 6 #include <uf_part.h> 7 8 UF_initialize(); 9 10 //遍历当前显示部件 11 tag_t NextTag = NULL_TAG; 12 int Type1, SubType1; 13 do 14 { 15 NextTag = UF_OBJ_cycle_all(UF_PART_ask_display_part(), NextTag); 16 17 logical IsDisplayable; 18 UF_OBJ_is_displayable(NextTag, &IsDisplayable);//获取显示在NX交互界面的对象 19 20 if (IsDisplayable == true) 21 { 22 UF_OBJ_ask_type_and_subtype(NextTag, &Type1, &SubType1);//查询存在的所有类型 23 24 if (Type1 == UF_drafting_entity_type && UF_draft_note_subtype)//判断找到所有注释 25 { 26 UF_DISP_set_highlight(NextTag, 1);//设置高亮 27 } 28 } 29 30 } while (NextTag != NULL_TAG); 31 32 33 UF_terminate();