|
楼主 |
发表于 2018-6-25 11:21
|
显示全部楼层
status=ProSolidFeatVisit(mdl,(ProFeatureVisitAction)FeatureAsmVisitAcFn1,FeatFilterAction,(CArray<ProFeature,ProFeature>*)&feat_list1);
int num1=(int)feat_list1.GetCount();
for (int s=0;s<num1;s++)
{
ProSolid mdl1;
status=ProAsmcompMdlGet((ProAsmcomp *)(&feat_list1[s]),(ProMdl *)&mdl1);
ProMdlNameGet(mdl1,name);//获得模型名称
csName=CString(name);//元件名称转为字符串
if(name==m_name1||name==m_name2)//如果某一行的零件名称与遍历得到的零件名称一样则创建简化表示
{
comp_id_table[0]=feat_list[i].id;
comp_id_table[1]=-1;
status=ProAsmcomppathInit((ProSolid)mdl,comp_id_table,1,&comp_path);//获得元件的路径,作用极其大
status = ProMdlToModelitem(mdl, &model_item);
status = ProSimprepdataitemInit( comp_path.comp_id_table,comp_path.table_num, model_item.id, &sr_action,&item);//初始化简化数据
status = ProSimprepdataitemAdd (data, &item);//添加简化数据
}
}
}
}
}
status = ProSimprepCreate ((ProSolid)owner, data, &simp_rep);//创建简化表示
if (status == PRO_TK_NO_ERROR)
{
status = ProSimprepActivate ((ProSolid)owner, &simp_rep);//激活简化模型
}
status = ProSolidDisplay ((ProSolid)owner);//显示简化模型
}
status = ProSimprepdataFree (&data);//释放数据 |
|