iCAx开思工具箱
标题:
UG二次开发 按类选择对话框
[打印本页]
作者:
liuhuisdu
时间:
2011-12-2 12:20
标题:
UG二次开发 按类选择对话框
大家好,我想实现拉伸功能(先选择线框,然后拉伸),但是按类选择对话框打不开。。代码如下:
int Project_Model_Create_Extrustion(ModelMandrelParameter *p_mandrel_para,tag_t *p_ext_tag)
{
uf_list_p_t loop_list,features;
char *taper_angle="0.0",*limit[2],limit1[2][30];
double ref_pt[3];
double direction[3] = {0.0,0.0,1.0};
int i,err;
char cue[] = "选择型材线框";
char title[] = "按类选择对话框";
int response, count;
tag_p_t objects;
char message[200];
sprintf(taper_angle,"%lf",p_mandrel_para->A);
sprintf(limit1[0],"%lf",p_mandrel_para->S);
sprintf(limit1[1],"%lf",p_mandrel_para->E);
limit[0]=limit1[0];limit[1]=limit1[1];
UF_MODL_create_list(&loop_list);
if((UF_CALL(UF_UI_select_with_class_dialog(
cue, title, UF_UI_SEL_SCOPE_WORK_PART,
NULL, NULL, &response, &count, &objects))) == 0)
{
printf("object count = %d\n",count);
if (response == UF_UI_OK && count > 0)
{
for (i=0; i<count; i++)
{
UF_DISP_set_highlight(objects[i], 0);
UF_MODL_put_list_item(loop_list,objects[i]);
}
UF_free(objects);
}
}
err=UF_MODL_create_extruded(loop_list, taper_angle, limit,
ref_pt, direction, UF_NULLSIGN,&features);
if(err!=0)
{
UF_get_fail_message( err,message);
uc1601(message,1);
return err;
}
UF_MODL_ask_list_item(features,0,p_ext_tag);
UF_MODL_delete_list(&features);
return err;
}
作者:
huqy168
时间:
2012-2-15 09:39
不懂,帮你顶下,我也好想学
作者:
Fisheep
时间:
2012-4-3 21:01
选择对话框函数代码少了,帮助文档上有例子,可以去看看
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3