iCAx开思工具箱
标题:
各位大哥,请帮忙看看下面的代码问题在什么地方!
[打印本页]
作者:
zhanghxing
时间:
2004-11-2 16:12
标题:
各位大哥,请帮忙看看下面的代码问题在什么地方!
tag_t to_part_occ,from_part_occ;
/*--------------------------------------------------*/
tag_t displayed_part=UF_PART[center][/center][center][/center][center][/center][center][/center]_ask_display_part();
tag_t root_tag=UF_ASSEM_ask_root_part_occ(displayed_part);
tag_t from_target_tags[2];
from_target_tags[0]=UF_ASSEM_ask_part_occ_of_inst(root_tag,from);
from_part_occ=from_target_tags[0];
tag_t to_target_tags[2];
to_target_tags[0]=UF_ASSEM_ask_part_occ_of_inst(root_tag,to);
to_part_occ=to_target_tags[0];
tag_t from_inst=UF_ASSEM_ask_inst_of_part_occ(from_part_occ);
/*-------------------------------------------------*/
UF_ASSEM_mating_condition_t ftf;
ftf.mated_object=from_inst;
ftf.name=NULL;
ftf.user_name=FALSE;
ftf.constraints[0].from_status=UF_ASSEM_ok;
ftf.constraints[0].to_status=UF_ASSEM_ok;
ftf.constraints[0].mate_type=UF_ASSEM_v16_mate;
ftf.constraints[0].from_type=UF_ASSEM_planar_face;
ftf.constraints[0].to_type=UF_ASSEM_planar_face;
ftf.constraints[0].from = from_face;
ftf.constraints[0].from_part_occ = from_part_occ;
ftf.constraints[0].to = to_face;
ftf.constraints[0].to_part_occ = to_part_occ;
ftf.constraints[0].offset=NULL_TAG;
ftf.constraints[0].name="face_to_face_mate";
ftf.constraints[0].user_name=TRUE;
ftf.num_constraints=1;
ftf.suppressed=FALSE;
UF_ASSEM_mc_status_t status;
UF_ASSEM_mc_structure_state_t struct_status;
UF_ASSEM_dof_t dof;
double transform[4][4];
int ret=UF_ASSEM_solve_mc([$ftf,&status,&dof,transform)]
if(ret==0 ||status==UF_ASSEM_mc_solved)
{
ret=UF_ASSEM_apply_mc_data([$ftf,&struct_status,&status)]
UF_DISP_refresh();
UF_MODL_update();
}
作者:
wgwang
时间:
2004-11-2 19:40
有什么出错提示吗
作者:
zhanghxing
时间:
2004-11-2 22:12
一个是 int ret=UF_ASSEM_solve_mc([$ftf,&status,&dof,transform)]的返回值是很大的一个整数,不是0,
再一个就是没有得到预计的效果,也就是实现两个面的贴合操作。我估计是tag_t to_part_occ,from_part_occ的原因,但是不知道该如何设置才好,因为再上面的遍历中得到的是对象的ID,而后来的贴合操作是针对对象tag的,我仔细的研究了清华那本书上的程序,发现ID与TAG好像是一致的,但是不成。
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3