iCAx开思网

标题: UF_UI_select_with_single_dialog实体过滤 [打印本页]

作者: LIUCHANGLIN    时间: 2010-8-6 14:56
标题: UF_UI_select_with_single_dialog实体过滤
单选或多选时,我如只想选实体,因为UF_solid_type分为片体同实体,我是选中后再去分实体和片体
有没有办法在选之前就过滤呢


static int init_proc(UF_UI_selection_p_t select,
                    void *user_data);
static void do_ugopen_api(void)
{
    char cue[] = "cue message";
    char title[] = "dialog title";
    int response;
    tag_t object, view;
    double cursor[3];
int type;
int sub_type;
    if(!(UF_UI_select_with_single_dialog(cue,title,
  UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
  &response, &object, cursor, &view)))
    {
      
  UF_OBJ_ask_type_and_subtype(object, &type, &sub_type);    //查找子类型
        if(70 == type && sub_type==0)      //&& 逻辑与
     {
      UF_MODL_ask_body_type(object, &type);
      if(type==UF_MODL_SOLID_BODY)
      {
   
       UF_OBJ_set_color (object,77);
      }
      else
       {
       uc1601("你选择的对象是片体!",1);
       }
      
     }
   
        
        /* unhighlight selected object */
        UF_DISP_set_highlight(object,0);
    }
}
/* selection initialization procedure */
static int init_proc(
      UF_UI_selection_p_t select,
      void* user_data)
{
    int num_triples = 1;
    UF_UI_mask_t mask_triples[] = {
    UF_solid_type,0,0};
  /* enable only lines and sold */
  if((UF_UI_set_sel_mask(select,
            UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,
            num_triples, mask_triples)) == 0 )
  {
   return (UF_UI_SEL_SUCCESS);//SUCCESS成功
  }
  else
  {
   return (UF_UI_SEL_FAILURE);//FAILURE失败
  }
}
作者: LIUCHANGLIN    时间: 2010-8-12 17:12
不会也顶一下!
作者: zale_lzj    时间: 2010-8-12 18:12
UF_UI_mask_t mask_triples[] = {
    UF_solid_type,0,0};  
改成
UF_UI_mask_t mask_triples[] = {
    UF_solid_type, UF_solid_body_subtype, UF_UI_SEL_FEATURE_SOLID_BODY
};
即可
作者: hello_icax    时间: 2010-8-13 11:35
学习中,谢谢!
作者: LIUCHANGLIN    时间: 2010-8-14 17:16
多谢!!!
作者: CUI821228    时间: 2010-8-23 15:25
还没有解决???
作者: Bambus    时间: 2010-8-27 11:21
3楼的应该可以了。。。




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3