|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
单选或多选时,我如只想选实体,因为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失败
}
} |
|