iCAx开思工具箱

标题: UF_MODL_create_simple_hole [打印本页]

作者: CUI821228    时间: 2010-7-22 16:02
标题: UF_MODL_create_simple_hole
创建一个方块,要在一个面上打一个孔,但是老是弹出特征定位对话框,提示特征位置欠定义怎么解决。代码如下,请高人指教。
UF_FEATURE_SIGN sign=UF_NULLSIGN;
  double corner_pt [ 3 ]={0.0,0.0,0.0};
  char  *edge_len [ 3 ]={"20","20","20"};
  tag_t  blk;
  UF_MODL_create_block1(sign,corner_pt,edge_len,&blk);
  tag_t body;
  UF_MODL_ask_feat_body(blk,&body);
  uf_list_p_t face_list;
  UF_MODL_create_list(&face_list);
  UF_MODL_ask_body_faces(body,&face_list);
  int count;
  UF_MODL_ask_list_count(face_list,&count);
  char face_num[20];
  sprintf(face_num,"%d",count);
  uc1601(face_num,1);
  tag_t face;
  int type;
  double point[3],box[6],dir[3],direct[3]={0.0,0.0,1.0};
  double face_radius,face_rad_data;
  int norm_dir,t=0;
  tag_t bplanes[256];
  double origin [ 3 ];
  for (int i=0;i<count;i++)
  {
   UF_MODL_ask_list_item(face_list,i,&face);
   UF_MODL_ask_face_data(face,&type,point,dir,box,&face_radius,&face_rad_data,&norm_dir);
   if (point[2]==20)
   {
    origin[0]=point[0];
    origin[1]=point[1];
    origin[2]=point[2];
    bplanes[0]=face;
    }
   else if(point[2]==0)
   {
    bplanes[1]=face;
   }

  }
  UF_MODL_delete_list(&face_list);
  tag_t H1;
  UF_MODL_create_simple_hole(origin,direct,"12","20","0",bplanes[0],bplanes[1],&H1);






欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3