NX二次开发-UFUN创建直线阵列UF_MODL_create_linear_iset

例子转载自 唐工NX二次开发论坛http://www.nxopen.cn/thread-1134-1-11.html

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

NX9+VS2012

#include 
#include 


UF_initialize();

//创建块
UF_FEATURE_SIGN blockSign = UF_NULLSIGN;
double blockCorner[3] = { 0.0, 0.0, -25.0 };
char *blockEdge[3] = { "100", "50", "25" };
tag_t blockfeat1TAG = NULL_TAG;
UF_MODL_create_block1(blockSign, blockCorner, blockEdge, &blockfeat1TAG);
tag_t blockBodyTag = NULL_TAG;
UF_MODL_ask_feat_body(blockfeat1TAG, &blockBodyTag);

//创建1个球
double sphereCenter[3] = { 10.0, 10.0, 0.0 };
tag_t sphereTag = NULL_TAG;
UF_MODL_create_sphere(UF_POSITIVE, blockBodyTag, sphereCenter, "10.0", &sphereTag);

//创建线性阵列
int method = 0;//0 = General 1 = Simple 2 = Identical
char *numberOfX = "3.0";
char *distanceOfX = "30.0";
char *numberOfY = "2.0";
char *ditanceofY = "25.0";
uf_list_p_t featureList;
UF_MODL_create_list(&featureList);
UF_MODL_put_list_item(featureList, sphereTag);

tag_t featureTag = NULL_TAG;
UF_MODL_create_linear_iset(method, numberOfX, distanceOfX, numberOfY, ditanceofY, featureList, &featureTag);
UF_MODL_delete_list(&featureList);

UF_terminate();

Caesar卢尚宇
2020年5月20日

NX二次开发-UFUN创建直线阵列UF_MODL_create_linear_iset_第1张图片

你可能感兴趣的:(NX二次开发-UFUN创建直线阵列UF_MODL_create_linear_iset)