UG NX 二次开发 技术交流 qq群:641226372
UF_initialize();
std::vector color0=colorPicker0->GetProperties()->GetIntegerVector("value");
int color01=color0[0];
tag_t object=face_select0->Tag();
double point[4][3];
double uv_min_max[4];
UF_MODL_ask_face_uv_minmax (object, uv_min_max );
double param[2];
double u1[3];
double v1[3];
double u2[3];
double v2[3];
double unit_norm[3];
double radii[2];
param[0]=uv_min_max [0];
param[1]=(uv_min_max [2]+uv_min_max [3])/2;
UF_MODL_ask_face_props (object,param,point[0],u1,v1,u2,v2,unit_norm,radii);
param[0]=uv_min_max [1];
param[1]=(uv_min_max [2]+uv_min_max [3])/2;
UF_MODL_ask_face_props (object,param,point[1],u1,v1,u2,v2,unit_norm,radii);
param[0]=(uv_min_max [0]+uv_min_max [1])/2;
param[1]=uv_min_max [2];
UF_MODL_ask_face_props (object,param,point[2],u1,v1,u2,v2,unit_norm,radii);
param[0]=(uv_min_max [0]+uv_min_max [1])/2;
param[1]=uv_min_max [3];
UF_MODL_ask_face_props (object,param,point[3],u1,v1,u2,v2,unit_norm,radii);
UF_CURVE_line_t line_coords;
tag_t line_tag;
line_coords.start_point[0]=point[0][0];
line_coords.start_point[1]=point[0][1];
line_coords.start_point[2]=point[0][2];
line_coords.end_point[0]=point[1][0];
line_coords.end_point[1]=point[1][1];
line_coords.end_point[2]=point[1][2];
UF_CURVE_create_line(&line_coords,&line_tag);
UF_OBJ_set_color(line_tag,color01);
line_coords.start_point[0]=point[2][0];
line_coords.start_point[1]=point[2][1];
line_coords.start_point[2]=point[2][2];
line_coords.end_point[0]=point[3][0];
line_coords.end_point[1]=point[3][1];
line_coords.end_point[2]=point[3][2];
UF_CURVE_create_line(&line_coords,&line_tag);
UF_OBJ_set_color(line_tag,color01);
tag_t view_tag=NULL_TAG;
double fraction=1.0;
UF_VIEW_fit_view(view_tag,fraction);
UF_terminate();