NX二次开发-NXString转换为char*方法
NX9+VS2012
#include <uf.h>
#include <uf_drf.h>
#include <NXOpen/Annotations_Note.hxx>
#include <NXOpen/NXObjectManager.hxx>
UF_initialize();
//创建注释
char* TextString[] = {"Caesar卢尚宇"};
double Origin3d[3] = {100,100,100};
tag_t NoteTag = NULL_TAG;
UF_DRF_create_note(1, TextString, Origin3d, 0, &NoteTag);
//读取注释
Annotations::Note *note1(dynamic_cast<Annotations::Note *>(NXObjectManager::Get(NoteTag)));
std::vector<NXString> Notes = note1->GetText();
//打印
lw->Open();
lw->WriteLine(Notes[0].GetLocaleText());
UF_terminate();