许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  VS2010 + Creo 2.0删除零件的操作

VS2010 + Creo 2.0删除零件的操作

阅读数 102
点赞 0
article_banner

构造要删除零件的特征del_feat


	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;}


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删


相关文章
技术文档
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空