【NX二次开发】创建有界平面UF_MODL_create_bplane
作者:互联网
先准备几条曲线如下图所示,我们用这几条边来创建一个有界平面
源码:
//有界平面 extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UF_initialize(); uc1601("有界平面", 1); tag_t tagLine[6] = { 45888,46337,46215,46015,45057,45256 }; UF_STRING_t generator; UF_STRING_p_t ge = &generator; UF_MODL_init_string_list(ge); int iqy = 2;//闭合环数量 int iby = 6;//边缘总数 UF_MODL_create_string_list(iqy, iby, ge); ge->id[0] = tagLine[0]; ge->id[1] = tagLine[1]; ge->id[2] = tagLine[2]; ge->id[3] = tagLine[3]; ge->id[4] = tagLine[4]; ge->string[0] = 5;//第1条环有几条边 ge->dir[0] = 1; //方向1、-1意义不大 ge->id[5] = tagLine[5]; ge->string[1] = 1; //第2条环有几条边 ge->dir[1] = 1; double tol[3]; //公差 tol[0] = 0.001; tol[1] = 0.5 * (PI / 180); tol[2] = 0.02; tag_t tagFace1 = 0; UF_MODL_create_bplane(ge, tol, &tagFace1);//有界平面 UF_terminate(); } extern int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }
效果:
标签:int,tagLine,create,bplane,ge,tol,二次开发,UF,id 来源: https://www.cnblogs.com/KMould/p/14312093.html