VS2010 Creo2.0 删除零件
2015-06-23 14:56
274 查看
构造要删除零件的特征del_feat
ProFeatureDelete函数
ProError featureDel(ProFeature *feat)
动作函数
ProError ProFeatureVisitAction_f10(ProFeature* p_feature, ProError status, ProAppData app_data);
ProError ProFeatureVisitAction_f10(ProFeature* p_feature, ProError status, ProAppData app_data)
{
std::vector<ProFeature>* pls = (std::vector<ProFeature>*)app_data;
ProMdl p_mdl_handle;
ProError err;
ProFeattype p_type;
ProMdlType ptype;
ProBoolean p_is_auto_round_member;
err = ProFeatureTypeGet(p_feature, &p_type);
if (p_type == PRO_FEAT_COMPONENT)
{
ProAsmcompMdlGet((ProAsmcomp*)p_feature, &p_mdl_handle);
ProMdlTypeGet(p_mdl_handle, &ptype);
if (ptype == PRO_MDL_ASSEMBLY)
{
ProSolidFeatVisit((ProSolid)p_mdl_handle, ProFeatureVisitAction_f10, ProFeatureFilterAction_f10, app_data);
}
}
pls->push_back(*p_feature);
return PRO_TK_NO_ERROR;
}
过滤函数
ProError ProFeatureFilterAction_f10(ProFeature* p_parameter, ProAppData app_data);
ProError ProFeatureFilterAction_f10(ProFeature* p_parameter, ProAppData app_data)
{
return PRO_TK_NO_ERROR;
}
ProSelection *p_sel = NULL; int n_sel; ProMdl mdl; ProModelitem sel_item; ProFeature feature, p_feat_handle; ProMdl p_owner; ProAsmcomppath path; ProMdlCurrentGet(&mdl); std::vector<ProFeature> featls; err = ProSolidFeatVisit((ProSolid)mdl, ProFeatureVisitAction_f10, ProFeatureFilterAction_f10, &featls); err = ProSelect((char*)"prt_or_asm", 1, NULL,NULL, NULL, NULL, &p_sel, &n_sel); if (err != PRO_TK_NO_ERROR || n_sel < 1) return; err = ProSelectionAsmcomppathGet(p_sel[0], &path); if (err != PRO_TK_NO_ERROR) return; ProAsmcomppath father_path = path; father_path.table_num--; ProMdl father_mdl; err = ProAsmcomppathMdlGet(&father_path,&father_mdl); ProFeature del_feat; del_feat.owner = father_mdl; del_feat.id = path.comp_id_table[path.table_num-1]; del_feat.type = PRO_FEATURE; featureDel(&del_feat);
ProFeatureDelete函数
ProError featureDel(ProFeature *feat)
ProError err = PRO_TK_NO_ERROR; int featsDelids[1]; featsDelids[0]=feat->id; ProFeatureDeleteOptions delOps[]={PRO_FEAT_DELETE_NO_OPTS}; err=ProFeatureDelete((ProSolid)feat->owner,featsDelids,1,delOps,1); if (err != PRO_TK_NO_ERROR) return err; return err;
动作函数
ProError ProFeatureVisitAction_f10(ProFeature* p_feature, ProError status, ProAppData app_data);
ProError ProFeatureVisitAction_f10(ProFeature* p_feature, ProError status, ProAppData app_data)
{
std::vector<ProFeature>* pls = (std::vector<ProFeature>*)app_data;
ProMdl p_mdl_handle;
ProError err;
ProFeattype p_type;
ProMdlType ptype;
ProBoolean p_is_auto_round_member;
err = ProFeatureTypeGet(p_feature, &p_type);
if (p_type == PRO_FEAT_COMPONENT)
{
ProAsmcompMdlGet((ProAsmcomp*)p_feature, &p_mdl_handle);
ProMdlTypeGet(p_mdl_handle, &ptype);
if (ptype == PRO_MDL_ASSEMBLY)
{
ProSolidFeatVisit((ProSolid)p_mdl_handle, ProFeatureVisitAction_f10, ProFeatureFilterAction_f10, app_data);
}
}
pls->push_back(*p_feature);
return PRO_TK_NO_ERROR;
}
过滤函数
ProError ProFeatureFilterAction_f10(ProFeature* p_parameter, ProAppData app_data);
ProError ProFeatureFilterAction_f10(ProFeature* p_parameter, ProAppData app_data)
{
return PRO_TK_NO_ERROR;
}
相关文章推荐
- 偏相关函数
- 动漫人物之Aldnoah Zero:アセイラム・ヴァース・アリューシア 艾瑟依拉姆·薇瑟·艾莉欧斯亚 CV 雨宫天
- Java笔记:for循环
- ios 企业发布ipa 和 plist
- Flip Game Poj1753
- 关键字与修饰符的总结
- C#高级编程二十四天----修饰符
- Invert Binary Tree
- Bing Developer Assistant开发随记
- 基于jQuery图片自适应排列显示代码
- NSTimer
- boost 安装(转载)
- 设计原则
- js游戏引擎探索指南之Collie
- GridView实现单选效果
- socket之send与发送区的大小关系
- 日语学习之沪江N3基础 20150623 -5
- UVa 11463 - Commandos
- Maven之生成测试覆盖度的插件cobertura-maven-plugin的使用
- duilib list 获取选中的行ID 获取行数 获取行指针 获取本行索引