NX二次开发 PK创建拉伸 PK_BODY_extrude
//创建拉伸(输入片体或曲线实体,起始值减终止值不能为零)
bool PK_CreateExtrude(const PK_BODY_t profile, const double dir[3], const double start_dist, const double end_dist, PK_BODY_t& pkBody)
{
pkBody = PK_ENTITY_null;
if (PK_ENTITY_null == profile
|| fabs(end_dist - start_dist) < g_dist_tol)
return false;
double mm = 0.001;
PK_VECTOR1_t path;
PK_TOPOL_track_r_t tracking;
PK_TOPOL_local_r_t results;
PK_BODY_extrude_o_t options;
PK_BODY_extrude_o_m(options);
options.start_bound.distance = start_dist * mm;
options.end_bound.distance = end_dist * mm;
path.coord[0] = dir[0];
path.coord[1] = dir[1];
path.coord[2] = dir[2];
PK_BODY_extrude(profile, path, &options, &pkBody, &tracking, &results);
PK_TOPOL_track_r_f(&tracking);
PK_TOPOL_local_r_f(&results);
return true;
}