|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
你好
我正在做个课题,要通过交互方式,选择工程图中的线或圆
但我用uf_ui_select_with_dialog怎么试都不行。
你能帮帮我吗?
你个问题已经困我二周了。
多谢了
以下是我的程序
void ufusr(char *param, int *retcode, int param_len)
{
if(!UF_initialize())
{
GetPoint();
UF_terminate();
}
}
void GetPoint()
{
int res;
int num_intersects;
int type;
int n_visible,display = 1;
int n_clipped;
int i,j;
tag_t *visible;
tag_t *clipped;
tag_t view_tag;
tag_t line_tag;
double point[3],dp[3];
double z_vec[3];
double viewmatrix[9];
double firstp[3],secondp[3];
double my_point[3];
char view_name[100],mes[133];
int response,count;
tag_p_t objects;
res = UF_UI_select_with_class_dialog("no cur","this",UF_UI_SEL_SCOPE_WORK_PART_AND_OCC, NULL,NULL,[$response, &count, &objects)]
if(res)
{
UF_get_fail_message(res,mes);
uc1601(mes,1);
}
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
}
static int init_proc(
UF_UI_selection_p_t select,
void *user_data)
{
int res;
UF_UI_mask_t mask_triples[] = {
{UF_circle_type,UF_all_subtype,UF_OBJ_no_property},
{UF_line_type,UF_all_subtype,UF_OBJ_no_property},
{UF_solid_type,UF_solid_edge_subtype,UF_OBJ_solid_body_property},
{UF_drafting_entity_type,UF_draft_note_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_label_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_id_symbol_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_fpt_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_cntrline_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_linear_cntrln_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_full_cir_cntrln_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_part_cir_cntrln_subtype,UF_OBJ_no_property},//
{UF_drafting_entity_type,UF_draft_full_blt_circle_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_part_blt_circle_subtype,UF_OBJ_no_property},//
{UF_drafting_entity_type,UF_draft_offset_cntrpt_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_cyl_cntrln_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_sym_cntrln_subtype,UF_OBJ_no_property},//
{UF_drafting_entity_type,UF_draft_crosshatch_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_area_fill_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_solid_fill_subtype,UF_OBJ_no_property},//
{UF_drafting_entity_type,UF_draft_intersection_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_target_point_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_user_defined_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_draft_assorted_parts_subtype,UF_OBJ_no_property},
{UF_drafting_entity_type,UF_all_subtype,UF_OBJ_no_property},
{UF_group_type,UF_all_subtype,UF_OBJ_no_property},
{UF_view_type,UF_all_subtype,UF_OBJ_no_property},
{UF_user_defined_object_type,UF_all_subtype,UF_OBJ_no_property}};
res = UF_UI_set_sel_mask(select,UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,27,mask_triples);
if(res)
{
return (UF_UI_SEL_FAILURE);
}
return (UF_UI_SEL_SUCCESS);
} |
|