UF_initialize();
tag_t ps_tag = null_tag;
UF_PS_ask_ps_tag_of_object(objtag, &ps_tag);//通过NX对象获取PK对象
double mainDir[3] = { 0,0,1 };//求对象在主方向上的极限点,此处是在求正Z方向上的极限点
double mtx[9] = { 0 };
UF_MTX3_initialize_x(mainDir, mtx);
PK_BODY_find_extreme_o_t n = { true };
PK_TOPOL_t tp;
PK_VECTOR_t p;
PK_VECTOR_t x = { mtx[0],mtx[1],mtx[2] },
y = { mtx[3],mtx[4],mtx[5] },
z = { mtx[6],mtx[7],mtx[8] };
PK_BODY_find_extreme(ps_tag, x, y, z, &n, &p, &tp);//PK_FACE_find_extreme、PK_EDGE_find_extreme用法与之类似
double extreme_point[3];
extreme_point[0] = p.coord[0] * 1000.0;
extreme_point[1] = p.coord[1] * 1000.0;
extreme_point[2] = p.coord[2] * 1000.0;
tag_t a;
UF_MODL_create_sphere1(UF_NULLSIGN, extreme_point, "10", &a);
char msg[256];
sprintf(msg, "%f,%f,%f", extreme_point[0], extreme_point[1], extreme_point[2]);
uc1601(msg, 1);
标签:BODY,mtx,point,tag,二次开发,PK,find,extreme
From: https://blog.csdn.net/weixin_50805145/article/details/139774842