登录【网站注册】点击左边“微信账号登陆”图标,微信扫描即自动注册并登陆
搜索
查看: 1413|回复: 0

[UG] UG二次开发问题UF_UI_select_with_single_dialog()

[复制链接]
发表于 2014-5-23 08:30:00 | 显示全部楼层 |阅读模式
UG二次开发问题:我在建模环境下用UF_UI_select_with_single_dialog()没问题,在组件工程图模式下用UF_UI_select_with_single_dialog()却选 不中零件,是什么原因??
        tag_t object,view;
        char cue[] = "select object ";
        int scope = UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY;//UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY,UF_UI_SEL_SCOPE_WORK_PART
        char part_fspec [ MAX_FSPEC_SIZE+1 ];
        int  response;
        double cursor[3];
        tag_t part_tag;
        CString infro;

        UF_UI_select_with_single_dialog(cue,"select the object",scope, UF_UI_sel_part, NULL, &response, &object, cursor, &view );
        if (response == UF_UI_OBJECT_SELECTED ||
                response == UF_UI_OBJECT_SELECTED_BY_NAME)
        {
                UF_DISP_set_highlight(object,0);
                UF_MODL_update();
        }
static int UF_UI_sel_part(UF_UI_selection_p_t select, void * user_data)
{  
        UF_UI_mask_t  mask_triples[] = {UF_component_type, 0, 0};//UF_component_type(组件中选择零件)
        if (UF_CALL(UF_UI_set_sel_mask(select,UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,1,mask_triples))==0)
        {
                return (UF_UI_SEL_SUCCESS);
        }
        else
        {
                return (UF_UI_SEL_FAILURE);
        }
}
论坛发布招 ...
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


快速回复 返回顶部 返回列表