|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
哪位高手可以帮忙看一下应该怎么改,实现:点击曲线,生成管道。现在这个程序只能生成一次管道,再点就不管用了
#include <stdio.h>
#include <uf.h>
#include <uf_modl.h>
#include <uf_ui.h>
static int sel_init_proc(UF_UI_selection_p_t select,void *user_data)
{
int err,num_tripels=2;
UF_UI_mask_t mask_triples[]={UF_spline_type,0,0,UF_line_type,0,0,};
err=UF_UI_set_sel_mask(select,UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,
num_tripels,mask_triples);
if(err==0) return UF_UI_SEL_SUCCESS;
else return UF_UI_SEL_FAILURE;
}
static void do_ugopen_api(void)
{
char cue[] = "选择曲线";
char title[] = "选择曲线";
int response, count, i;
tag_p_t obj_line;
int obj_tube;
char*body_limit[2]={"outer_diameter=16","inner_diameter=0"};
tag_t generators[1];
UF_MODL_SWEEP_TRIM_object_p_t trim_data = NULL;
UF_FEATURE_SIGN mode_sign = UF_NULLSIGN;
if(((UF_UI_select_with_class_dialog(cue, title, UF_UI_SEL_SCOPE_WORK_PART,
sel_init_proc, NULL, &response, &count, &obj_line))) == 0)
{
printf("obj_line count = %d\n",count);
if (response == UF_UI_OK && count > 0)
{
for (i=0; i<count; i++)
{
printf("obj_line tag = %d\n", obj_line);
UF_DISP_set_highlight(obj_line, 0);
generators[0] =obj_line;
(UF_MODL_create_trimmed_tube(generators,1, trim_data,
body_limit,mode_sign, &obj_line, &obj_tube));
}
UF_free(obj_line);
}
}
}
void ufusr(char *param, int *retcode, int param_len)
{
if (!(UF_initialize()))
{
do_ugopen_api();
(UF_terminate());
}
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
} |
|