#include "uf_all.h"
#include "uf_cam_all.h"
#include "HuNXOpen.h"
void ufusr(char *parm, int*returnCode, int rlen)
{
UF_initialize();
char *cutter_type = "mill_planar";
char *cutter_subtype = "MILL";
tag_t D10, tool_group, ma_group;
char *Tool_name = "D10";
tag_t operTag;
UF_CUTTER_create("mill_planar", "MILL", &D10);
UF_SETUP_ask_setup(&tool_group);
UF_SETUP_ask_mct_root(tool_group, &ma_group);
UF_NCGROUP_accept_member(ma_group, D10);
UF_OBJ_set_name(D10, Tool_name);
//创建刀具,默认刀具为D10;
UF_PARAM_set_double_value(D10, UF_PARAM_TL_DIAMETER, 10);//刀具直径(DIAMETER)
char*type_name = "mill_planar";//定义加工类型
char*subtype_name = "planar_mill";//定义子类型
UF_PARAM_set_double_value(operTag, UF_PARAM_TL_Z_OFFSET, 0.0000);//机床控制z 偏置
UF_PARAM_set_double_value(operTag, UF_PARAM_SURFACE_SPEED, 0.0000);//表面速度
UF_PARAM_feedrate_t feedrateVla;
UF_PARAM_ask_subobj_ptr_value(operTag, UF_PARAM_FEED_CUT, &feedrateVla);
feedrateVla.value = 250;
UF_PARAM_set_subobj_ptr_value(operTag, UF_PARAM_FEED_CUT, &feedrateVla); //设置进给率速度
double InOutVlaue[2] = { 0.03, 0.12 };
UF_PARAM_set_2d_value(operTag, UF_PARAM_TOL_IN_OUT, InOutVlaue);//内外公差
UF_PARAM_set_int_value(operTag, UF_PARAM_CUT_METHOD, UF_PARAM_dpm_cut_pattern_follow);//设置切削模式为跟随周边
UF_terminate();
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
}
1>------ 已启动生成: 项目: NX12_kaifa_2, 配置: Debug x64 ------
1> NX12_kaifa_2.cpp
1>D:\NX_Lib\UGopenLib\NX12.0.2.9\UGOPEN\NXOpen/NXException.hxx(27): warning C4275: 非 dll 接口 class“std::exception”用作 dll 接口 class“NXOpen::NXException”的基
1> D:\VS2015\VC\include\vcruntime_exception.h(43): note: 参见“std::exception”的声明
1> D:\NX_Lib\UGopenLib\NX12.0.2.9\UGOPEN\NXOpen/NXException.hxx(26): note: 参见“NXOpen::NXException”的声明
1>d:\nx12.0\eckf\_source\nx12_kaifa_2\nx12_kaifa_2\nx12_kaifa_2.cpp(26): warning C4700: 使用了未初始化的局部变量“operTag”
1> 正在创建库 ..\..\..\Application\/NX12_kaifa_2.lib 和对象 ..\..\..\Application\/NX12_kaifa_2.exp
1> NX12_kaifa_2.vcxproj -> D:\NX12.0\ECKF\_Source\NX12_kaifa_2\NX12_kaifa_2\..\..\..\Application\NX12_kaifa_2.dll
========== 生成: 成功 1 个,失败 0 个,最新 0 个,跳过 0 个 ==========