NX二次开发-UFUN创建圆形阵列UF_MODL_create_circular_iset

例子转载自 胡工NX二次开发论坛https://www.ugapi.com/thread-1028.html

用这个函数做圆形阵列必须要执行布尔运算,不做布尔运算,或者布尔运算失败,函数就会执行失败。

NX9+VS2012

#include <uf.h>
#include <uf_modl.h>


UF_initialize();

double origin[3] = { 0.0, 0.0, 0.0 };
double orig_iset[3] = { 0.0, -0.75, 0.0 };
double direction[3] = { 0.0, 0.0, 1.0 };
char *height = ".25";
char *diam_cover = "2.0";
char *diam_hole = "0.5625";
char *diam_iset = "0.21875";
char *part_name = "cover";
UF_FEATURE_SIGN create = UF_NULLSIGN;
UF_FEATURE_SIGN sub = UF_NEGATIVE;
tag_t cover_id, hole_id, iset_id, feat_obj, part;
uf_list_p_t feat_list;
int english_units = 2;

UF_MODL_create_cyl1(create, origin, height, diam_cover, direction,&cover_id);

UF_MODL_create_cyl1(sub, origin, height, diam_hole, direction,&hole_id);

UF_MODL_create_cyl1(sub, orig_iset, height, diam_iset, direction,&iset_id);
UF_MODL_create_list(&feat_list);
UF_MODL_put_list_item(feat_list, iset_id);

UF_MODL_create_circular_iset(0, origin, direction, "3", "120",feat_list, &feat_obj);

UF_MODL_delete_list(&feat_list);

UF_terminate();

Caesar卢尚宇
2020年5月20日

猜你喜欢

转载自www.cnblogs.com/nxopen2018/p/12925844.html