NX/UG二次开发—刀路事件类型注意事项

一、在做刀路编辑的时候,如果基于NX12以及以上版本,NXOpen封装好了编辑和读取刀路的函数,但是在一些低版本中,实现此功能,需要一些dll导出函数。在libcamsja.dll中NX也封装了一些比较方便的函数,但对于没有内部文档的非正规军,很难去猜测函数的参数类型。但可以通过apimotion可以看到一些调用函数,可以在libcams.dll中全部找到对应的编辑函数。在测试发现一些设置是无效的,开始以为函数不对,后来发现,刀路事件是分类型的,在UFUN帮助文档中给出了明确的类型:

#define    UF_cevent_3x_linear_subtype               150
#define    UF_cevent_3x_linear_with_feed_subtype     151
#define    UF_cevent_3x_linear_cust_feed_subtype     152
#define    UF_cevent_5x_linear_subtype               153
#define    UF_cevent_5x_linear_with_feed_subtype     154
#define    UF_cevent_5x_linear_cust_feed_subtype     155
#define    UF_cevent_3x_circular_subtype             156
#define    UF_cevent_3x_circular_with_feed_subtype   157
#define    UF_cevent_3x_circular_cust_feed_subtype   158
#define    UF_cevent_5x_circular_subtype             159
#define    UF_cevent_5x_circular_with_feed_subtype   160
#define    UF_cevent_5x_circular_cust_feed_subtype   161
#define    UF_cevent_3x_helical_subtype              162
#define    UF_cevent_3x_helical_with_feed_subtype    163
#define    UF_cevent_3x_helical_cust_feed_subtype    164
#define    UF_cevent_5x_helical_subtype              165
#define    UF_cevent_5x_helical_with_feed_subtype    166
#define    UF_cevent_5x_helical_cust_feed_subtype    167
#define    UF_cevent_3x_nurbs_subtype                168
#define    UF_cevent_3x_nurbs_with_feed_subtype      169
#define    UF_cevent_3x_nurbs_cust_feed_subtype      170
#define    UF_cevent_5x_nurbs_subtype                171
#define    UF_cevent_5x_nurbs_with_feed_subtype      172
#define    UF_cevent_5x_nurbs_cust_feed_subtype      173

二、比如3轴或定轴刀路,编辑刀路界面中是不包含指定轴的,可以看下两张图对比,第一张图是三轴程序,第二张图是五轴程序:

NX/UG二次开发—刀路事件类型注意事项_第1张图片NX/UG二次开发—刀路事件类型注意事项_第2张图片

三、对于UDOP创建的刀路,可以发现,他的运动类型是定制,与自带策略创建的刀路是不同的,二次修改程序转速进给,刀路是不继承的,还需要重新生成刀路,才生效。主要原因是,UFUN函数调用的底层逻辑创建的刀路类型是***_cust_feed_subtype类型,而且并没有提供设置接口。因此,可以通过刀轨编辑,来实现feed参数的调整。

你可能感兴趣的:(NX二次开发,刀轨编辑)