NX二次开发-获取尺寸的附加文本UF_DRF_ask_appended_text
#include
#include
#include
#include
#include
UF_initialize();
//遍历所有尺寸
int type = 0;
tag_t DimTag = NULL_TAG;
UF_OBJ_cycle_objs_in_part1(UF_PART_ask_display_part(), UF_dimension_type, &DimTag);//遍历所有尺寸
while (DimTag != NULL_TAG)
{
//获取尺寸的附加文本
int num_text = 0;
UF_DRF_appended_text_p_t appended_text;
UF_DRF_ask_appended_text(DimTag, &num_text, &appended_text);
UF_DRF_appended_text_location_t loca = appended_text->location;//获得附加文本位置
int num = appended_text->num_lines;//获得附加文本行数
for (int i = 0; i < num; i++)
{
char* text = appended_text->text[i];//获得附加文本内容
uc1601(text, 1);
}
if (loca ==UF_DRF_APPENDED_TEXT_AFTER)
{
uc1601("附加文本在尺寸之后", 1);
}
char msg[256];
sprintf_s(msg, "附加文本有几%d行&