【NX二次开发】UF_MODL_create_taper_from_edges()边拔模

边拔模函数UF_MODL_create_taper_from_edges()的第一个参数为tag_t类型的矢量,可以使用UF_SO_create_dirr_doubles()来获取。下面是例子

 1 #include "Text.h"
 2 extern DllExport void ufusr(char *param, int *returnCode, int rlen)
 3 {
 4     UF_initialize();
 5 
 6     //将double类型的方向转换为tag_t类型
 7     tag_t tagEdge = 46629;
 8     tag_t tagDir = NULL_TAG;
 9     double douDir[3] = { 0,0,1 };
10     UF_SO_update_option_t update_option = UF_SO_update_within_modeling;
11     tag_t tagObjectInPut = UF_PART_ask_display_part();
12     UF_SO_create_dirr_doubles(tagObjectInPut, update_option, douDir, &tagDir);
13 
14     //边拔模
15     char *cAngle = "10";
16     logical taper_all_instances = FALSE;
17     int numEdges = 1;
18     tag_t tagEdges[1] = { tagEdge };
19     tag_t tagFeature_taper;
20     UF_MODL_create_taper_from_edges(tagDir, cAngle, taper_all_instances, numEdges, tagEdges, &tagFeature_taper);
21 
22     UF_terminate();
23 }
24 
25 extern int ufusr_ask_unload(void)
26 {
27     return (UF_UNLOAD_IMMEDIATELY);
28 }

效果:

 

posted @ 2020-08-03 14:20  王牌飞行员_里海  阅读(65)  评论(0编辑  收藏  举报