1 #include <uf.h> 2 #include <uf_drf.h> 3 #include <uf_obj.h> 4 #include <uf_part.h> 5 #include <uf_ui.h> 6 7 8 UF_initialize(); 9 10 //遍历所有尺寸 11 int type = 0; 12 tag_t DimTag = NULL_TAG; 13 UF_OBJ_cycle_objs_in_part1(UF_PART_ask_display_part(), UF_dimension_type, &DimTag);//遍历所有尺寸 14 while (DimTag != NULL_TAG) 15 { 16 //获取尺寸的附加文本 17 int num_text = 0; 18 UF_DRF_appended_text_p_t appended_text; 19 UF_DRF_ask_appended_text(DimTag, &num_text, &appended_text); 20 21 UF_DRF_appended_text_location_t loca = appended_text->location;//获得附加文本位置 22 23 int num = appended_text->num_lines;//获得附加文本行数 24 for (int i = 0; i < num; i++) 25 { 26 char* text = appended_text->text[i];//获得附加文本内容 27 uc1601(text, 1); 28 } 29 30 if (loca ==UF_DRF_APPENDED_TEXT_AFTER) 31 { 32 uc1601("附加文本在尺寸之后", 1); 33 } 34 35 char msg[256]; 36 sprintf_s(msg, "附加文本有几%d行", num); 37 uc1601(msg, 1); 38 39 //UF_DRF_free_appended_text(appended_text); 40 41 UF_OBJ_cycle_objs_in_part1(UF_PART_ask_display_part(), UF_dimension_type, &DimTag); 42 } 43 44 45 46 UF_terminate(); 47 48 caesar卢尚宇 49 2019年7月4日