找回密码 注册 QQ登录
开思网工业级高精度在线3D打印服务

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 18466|回复: 1
打印 上一主题 下一主题

关于函数UF_CAMGEOM_append_items()的问题

[复制链接]
跳转到指定楼层
1
发表于 2004-9-2 15:51:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
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)]恳请高手指点!谢谢!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2004-9-2 16:25:47 | 只看该作者
一部分代码如下:
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);
  }
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2025-2-7 07:06 , Processed in 0.025193 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2025 www.iCAx.org

快速回复 返回顶部 返回列表