求助::{
镜射特征中螺纹是否可见是不是由thread.include_instances =UF_MODL_INCL_INSTANCES控制?
为何镜射【mirror】特征中原来的螺纹不见了?
//----------------------- Create boss-----------------------
UF_MODL_create_boss(location1,direction,diam_boss,h_boss,angle,trim_face,[$boss_id)]
//------------------- Create a thread on boss---------------------
//Get boss faces to use as start face and cylinder face of the thread
tag_t s_face,c_face,thread_id;
uf_list_p_t list;
UF_MODL_create_list([$list)]
UF_MODL_symb_thread_data_t thread;
UF_MODL_ask_feat_faces(boss_id,[$list)]
UF_MODL_ask_list_count(list,[$num)]
for (i=0;i<num;i++)
{
UF_MODL_ask_list_item(list,i,[$face)]
UF_MODL_ask_face_data(face,&type,point,dir,box,
[$radius,&rad,&sen)]
if ( (type == 22) && (fabs(dir[1]-1.0)< 10e-7) )
s_face = face; //start face
if (type == 16)
c_face = face; //cylinder face
}
UF_MODL_delete_list([$list)]
//create thread
char thread_length[10];
thread_length[0]='\0';
sprintf(thread_length,"%f",0.5*atof(L.value.string)-hi-2.0);
thread.cyl_face = c_face;
thread.start_face = s_face;
thread.axis_direction[0]=0;
thread.axis_direction[1]=-1;
thread.axis_direction[2]=0;
thread.include_instances =UF_MODL_INCL_INSTANCES;
thread.rotation=UF_MODL_RIGHT_HAND;
thread.length_flag= UF_MODL_FIXED_LENGTH;
thread.tapered = UF_MODL_NON_TAPERED;
thread.num_starts = 1;
thread.length=thread_length;
thread.form = "Metric";
thread.method = "CUT";
thread.callout =callout;
thread.major_dia = "10";
thread.minor_dia = "8.917";
thread.tapped_dia = "9.813";
thread.pitch = "1.0";
thread.angle = "60";
UF_MODL_create_symb_thread([$thread, &thread_id)]
//-----------------chamfer edge of the boss--------------------------
uf_list_p_t boss_face_edge_list;
tag_t chamfer_id,mirror_obj;
UF_MODL_ask_face_edges (s_face,[$boss_face_edge_list)]
UF_MODL_create_chamfer (1, ".5", ".5", "45",boss_face_edge_list,[$chamfer_id)]
UF_MODL_delete_list([$boss_face_edge_list)]
UF_MODL_ask_feat_body(chamfer_id,[$mirror_obj)]
////////////////////////////////////////////////////////////////////////////////////////////
///--------------------create mirror feature-------------------------------------
double ctr_point[3] = {0.0, 0.0, 0.0};
double directiony[3] = {0.0, -1.0, 0.0};
tag_t mirror_tag,dplane, mirror_body;
//Create Datum Plane
UF_MODL_create_fixed_dplane(ctr_point, directiony, [$dplane)]
// Create a mirrored body
UF_MODL_create_mirror_body(mirror_obj,dplane,[$mirror_tag)]
UF_MODL_ask_feat_body(mirror_tag,[$mirror_body)]
//---------------------unite-------------------------------
UF_MODL_unite_bodies(mirror_obj,mirror_body); |