NX二次开发 UFUN读取工程图注释 UF_DRF_ask_text_data
//NX8.0+VS2010
#include <uf_assem.h>
#include <uf_part.h>
#include <uf_obj.h>
#include <uf_modl.h>
#include <uf_view.h>
#include <uf_draw.h>
#include <uf_drf.h>
extern DllExport void ufsta(char* param, int* returnCode, int rlen)
{
if (UF_initialize())
return;
//创建注释
char* sTextString[] = { "梅雷666" };
double origin3d[3] = { 100, 100, 100 };
tag_t tNoteTag = NULL_TAG;
UF_DRF_create_note(1, sTextString, origin3d, 0, &tNoteTag);
//询问注释对象的数据。可以通过将ann_data数组传递给UF_DRF_ask_text_data来读取注释的文本数据(老函数用uc5574读取)
int search_mask[4];
int cycle_flag = 0;
int ann_data[10];
int ann_data_type = 0;
int ann_data_form = 0;
int num_segments = 0;
double ann_origin[2];
double radius_angle = 0;
UF_DRF_ask_ann_data(&tNoteTag, search_mask, &cycle_flag, ann_data, &ann_data_type, &ann_data_form, &num_segments, ann_origin, &radius_angle);
//读取注释
int ip1 = 1;
char* cr3;
int ir4 = 0;
int ir5 = 0;
UF_DRF_ask_text_data(ip1, ann_data, &cr3, &ir4, &ir5);
//打印
uc1601(cr3, 1);
UF_terminate();
}