parent feature get

RemoveUnneededFeaturesInRail()
{
    ProError err;

    // 1. 遍歷所有模腳,查找QUILT_CUT的UDF
    // 2. 查看QUILT_CUT的父特徵
    // 3. 如果其父特徵是PULL_BACK中的特徵,則刪除
    int rail_num(0);
    err = ProArraySizeGet(frt_moldbase.rail_mdls, &rail_num);
    if (err != PRO_TK_NO_ERROR || rail_num < 1)
    {
        return PRO_TK_USER_ABORT;
    }

    char temp[PRO_NAME_SIZE];
    for (int i = 0; i < rail_num; ++i)
    {
        ProGroup *udfs;
        err = ProSolidGroupsCollect((ProSolid)frt_moldbase.rail_mdls[i], &udfs);

        ProName udf_name;
        ProName udf_instance;
        int udf_num(0);

        err = ProArraySizeGet(udfs, &udf_num);
        if (err != PRO_TK_NO_ERROR || udf_num < 1)
        {
            continue;
        }

        for (int j = 0; j < udf_num; ++j)
        {            
            bool is_unneeded_feat(false);

            err = ProUdfNameGet(&udfs[j], udf_name, udf_instance);
            ProWstringToString(temp, udf_name);
            if (stricmp(temp, "QUILT_CUT"))
            {
                continue;
            }

            int udf_feat_num(0);
            ProFeature *udf_feats;
            err = ProGroupFeaturesCollect(&udfs[j], &udf_feats);
            err = ProArraySizeGet(udf_feats, &udf_feat_num);
            if (err != PRO_TK_NO_ERROR || udf_feat_num < 2)
            {
                continue;
            }
                    
            // 第1個特徵是群組頭特徵,第2個特徵是CUTOUT特徵
            int parent_num(0);
            ProExtRefInfo    *parent_infos = NULL;
            err = ProFeatureExternParentsGet(&udf_feats[1], PRO_EXT_GEOM_REF, &parent_infos, &parent_num);
            for (int k = 0; k < parent_num; ++k)
            {
                for (int m = 0; m < parent_infos[k].n_refs; ++m)
                {
                    ProFeature  ref_feat;
                    err = ProExtRefFeatGet(parent_infos[k].ext_refs[m], &ref_feat);
                    if (err != PRO_TK_NO_ERROR)
                    {
                        continue;
                    }

                    ProName ref_feat_owner_name;
                    err = ProMdlNameGet(ref_feat.owner, ref_feat_owner_name);
                    ProWstringToString(temp, ref_feat_owner_name);
                    if (strstr(strupr(temp), "PB") != NULL)
                    {
                        // 此特徵是PULL_BACK中的特徵

                        is_unneeded_feat = true;
                        break;
                    }
                }

                if (is_unneeded_feat)
                {
                    break;
                }
            }
            // 刪除不需要的特徵
            if (is_unneeded_feat)
            {               
                ProFeatureDeleteOptions  deleteopt = PRO_FEAT_DELETE_CLIP;
                err = ProFeatureDelete((ProSolid)frt_moldbase.rail_mdls[i], &udf_feats[1].id, 1, &deleteopt, 1);
            }
           
            err = ProArrayFree((ProArray*)&udf_feats);
        }

        err = ProArrayFree((ProArray*)&udfs);
    }


    return PRO_TK_NO_ERROR;
}

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25306814/viewspace-702540/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25306814/viewspace-702540/

PS E:\system\Desktop\项目所需文件\工具\计时器工具> python -m pip uninstall pyinstaller Traceback (most recent call last): File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 151, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 118, in _get_module_details return _get_module_details(pkg_main_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 104, in _get_module_details spec = importlib.util.find_spec(mod_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\importlib\util.py", line 86, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\site-packages\pip\__init__.py", line 1 from __future__ import annotations SyntaxError: future feature annotations is not defined PS E:\system\Desktop\项目所需文件\工具\计时器工具> python -m pip uninstall pyinstaller Traceback (most recent call last): File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 151, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 118, in _get_module_details return _get_module_details(pkg_main_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 104, in _get_module_details spec = importlib.util.find_spec(mod_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\importlib\util.py", line 86, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\site-packages\pip\__init__.py", line 1 from __future__ import annotations SyntaxError: future feature annotations is not defined PS E:\system\Desktop\项目所需文件\工具\计时器工具> python -m pip install "pyinstaller==3.6" Traceback (most recent call last): File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 151, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 118, in _get_module_details return _get_module_details(pkg_main_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\runpy.py", line 104, in _get_module_details spec = importlib.util.find_spec(mod_name) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\importlib\util.py", line 86, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "C:\Users\cheny9210\AppData\Local\Programs\Python\Python34\lib\site-packages\pip\__init__.py", line 1 from __future__ import annotations SyntaxError: future feature annotations is not defined PS E:\system\Desktop\项目所需文件\工具\计时器工具>
最新发布
10-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值