NX CAM二次开发 UFUN获取当前加工导航器选中的对象数量和tag UF_UI_ONT_ask_selected_nodes
//NX8.0+VS2010
#include <uf.h>
#include <uf_ui.h>
#include <uf_ui_ont.h>
#include <uf_obj.h>
extern DllExport void ufsta(char* param, int* returnCode, int rlen)
{
if (UF_initialize())
return;
//获取当前加工导航器选中的对象数量和TAG
int count = 0;
tag_t* objects = NULL;
UF_UI_ONT_ask_selected_nodes(&count, &objects);
UF_UI_open_listing_window();
for (int i = 0; i < count; i++)
{
//打印
char name[257];
UF_OBJ_ask_name(objects[i], name);
UF_UI_write_listing_window(name);
UF_UI_write_listing_window("\n");
}
//释放
UF_free(objects);
UF_terminate();
}