UG NX二次开发源码分享:一键移除参数源代码分享
UG NX二次开发源码分享:一键移除参数源代码分享void plmhomeToolKits_removeParameters::do_it()
{
// TODO: add your code here
// get all the bodys;
std::vector<NXObject * > objects;
BodyCollection *bc = workPart->Bodies();
CurveCollection *cc = workPart->Curves();
PointCollection *pc = workPart->Points();
for(BodyCollection::iterator it = bc->begin();it!=bc->end();it++)
{
objects.push_back(*it);
}
for(CurveCollection::iterator it = cc->begin();it!=cc->end();it++)
{
objects.push_back(*it);
}
for(PointCollection::iterator it = pc->begin();it!=pc->end();it++)
{
objects.push_back(dynamic_cast<Point*>(*it));
}
Features::RemoveParametersBuilder *removeParametersBuilder1;
removeParametersBuilder1 = workPart->Features()->CreateRemoveParametersBuilder();
removeParametersBuilder1->Objects()->Add(objects);
if(removeParametersBuilder1->Validate())
{
NXObject *nXObject1;
nXObject1 = removeParametersBuilder1->Commit();<div> uc1601("All the Bodies,Curves,Points parameters were removed successfully!",1);
}
removeParametersBuilder1->Destroy();</div>
}
复制之后 有乱码呀 老师怎么选择只在显示界面的实体去参呢? 谢谢分享 老师辛苦了 谢谢分享
页:
[1]