iCAx开思网
标题:
关于函数UF_CAMGEOM_append_items()的问题
[打印本页]
作者:
tari
时间:
2004-9-2 15:51
标题:
关于函数UF_CAMGEOM_append_items()的问题
UF_CAMGEOM_append_items(objTag,UF_CAM_part, entity_count,entity_list,app_data_list);
错误提示是object is not the desired type,我输入的是body类型啊,UF_MODL_ask_face_body(faces[0],[$body)]恳请高手指点!谢谢!
作者:
tari
时间:
2004-9-2 16:25
一部分代码如下:
entity_count=0;
UF_UI_select_with_class_dialog(cue,atitle,UF_UI_SEL_SCOPE_WORK_PART,init_proc,NULL,[$response,&count,&object)]
tag_t faces[MAX_CAMGEOM];
int first_set_count;
for(int i=1;i<count;i++)
{
int irc=0;
char msg[132];
UF_MODL_face_blend_create_data_t create_data;
UF_MODL_init_face_blend_data([$create_data)]
char *tolerance="0.0254";
logical normal=true;
double param[2];
param[0]=0.5,param[1]=0.5;
double cpoint[3];
double u1,v1,u2,v2;
double radii[2];
double dir2[3];
UF_MODL_ask_face_props(object
,param,cpoint,[$u1,&v1,&u2,&v2,dir2,radii)]
if(dir2[0]>0)
normal=false;
if(i==1)
{
faces[0]=object[0];
first_set_count=1;
}
create_data.first_set=faces;
create_data.first_set_size=first_set_count;
create_data.flip_first_normal=true;
create_data.second_set=[$object
]
create_data.second_set_size=1;
create_data.flip_second_normal=normal;
create_data.blend_tolerance=tolerance;
create_data.trim_option=UF_TRIM_AND_ATTACH;
create_data.radius_type=UF_CONSTANT;
create_data.default_radius="4";
UF_MODL_blend_faces_limit_data_p_t limit_data=NULL;
tag_t feature_tag;
int num_bodies_created;
tag_t *bodies_created;
int num_blend_faces;
tag_t *blend_faces;
irc=UF_MODL_create_face_blend(&create_data,limit_data,&feature_tag,
[$num_bodies_created,&bodies_created,&num_blend_faces,&blend_faces)]
if(irc)
{
UF_get_fail_message(irc,msg);
printf("error=%s\n",msg);
}
faces[first_set_count]=object
;
first_set_count++;
if(irc==0)
{
uf_list_p_t object_list;
UF_MODL_ask_feat_faces(feature_tag,[$object_list)]
while(object_list!=NULL)
{
faces[first_set_count]=object_list->eid;
first_set_count++;
object_list=object_list->next;
}
}
}
if(((response==UF_UI_OBJECT_SELECTED)||(response==UF_UI_OK))&&count>0)
{
for(int i=0;i<first_set_count;i++)
{
entity_list[entity_count]=faces
;
app_data_list[entity_count]=
(UF_CAMGEOM_app_data_p_t)UF_allocate_memory(sizeof(UF_CAMGEOM_app_data_t),err_code);
init_camgeom_app_data(app_data_list[entity_count]);
entity_count++;
UF_DISP_set_highlight(faces
,0);
}
}
if(entity_count>0)
{
for(int i=0;i<obj_count;i++)
{
int type,subtype;
irc=UF_OBJ_ask_type_and_subtype(objTag,[$type,&subtype)]
if(type==UF_machining_operation_type||type==UF_machining_geometry_grp_type)
{
irc=UF_CAMGEOM_append_items(objTag,UF_CAM_cut_area,
entity_count,entity_list,app_data_list);
if(irc!=0)
{
UF_get_fail_message(irc,errorstrg);
}
}
}
}
tag_t body;
UF_MODL_ask_face_body(faces[0],[$body)]
entity_count=0;
entity_list[entity_count]=body;
app_data_list[entity_count]=
(UF_CAMGEOM_app_data_p_t)UF_allocate_memory(sizeof(UF_CAMGEOM_app_data_t),[$err_code)]
init_camgeom_app_data(app_data_list[entity_count]);
entity_count++;
if(entity_count>0)
{
for(int i=0;i<obj_count;i++)
{
int type,subtype;
irc=UF_OBJ_ask_type_and_subtype(objTag,[$type,&subtype)]
if(type==UF_machining_operation_type||type==UF_machining_geometry_grp_type)
{
irc=UF_CAMGEOM_append_items(objTag,UF_CAM_part,
entity_count,entity_list,app_data_list);
if(irc!=0)
{
UF_get_fail_message(irc,errorstrg);
}
}
}
}
for(i=0;i<entity_count;i++)
{
UF_free(app_data_list
);
}
欢迎光临 iCAx开思网 (https://www.icax.org/)
Powered by Discuz! X3.3