NX9+VS2012
#include <uf.h>
#include <uf_ui.h>
#include <uf_modl.h>
#include <uf_ui_ont.h>
#include <uf_param.h>
#include <uf_setup.h>
#include <uf_oper.h>
UF_initialize();
//获取加工设置
tag_t setup_tag = NULL_TAG;
UF_SETUP_ask_setup(&setup_tag);
//获取当前加工导航器选中的对象数量和TAG
int count = 0;
tag_t* objects = NULL_TAG;
UF_UI_ONT_ask_selected_nodes(&count, &objects);
for (int i = 0; i < count; i++)
{
//生成刀路
logical generated;
UF_PARAM_generate(objects[i], &generated);
//重播刀路
UF_PARAM_replay_path(objects[i]);
//生成后处理NC程序
UF_SETUP_generate_program(setup_tag, objects[i], "MILL_3_AXIS", "D:\123.nc", UF_SETUP_OUTPUT_UNITS_METRIC);
//卸载刀路
UF_OPER_unload_path(objects[i]);
}
//释放
UF_free(objects);
UF_terminate();
Caesar卢尚宇
2020年5月26日