其他分享
首页 > 其他分享> > NXOPEN创建组,并加入对象

NXOPEN创建组,并加入对象

作者:互联网

Part *workPart(theSession->Parts()->Work());

GroupBuilder* groupBuilder1 = workPart->CreateGatewayGroupBuilder(NULL);
groupBuilder1->SetGroupName("123");//设置组的名字

std::vector<TaggedObject *> objectsTag = selection0->GetSelectedObjects();//获取选择的对象
NXOpen::Body *body = dynamic_cast<NXOpen::Body *>(NXOpen::NXObjectManager::Get(objectsTag[0]->Tag()));//tag_t转NXObject
bool added1;
added1 = groupBuilder1->ObjectsInGroup()->Add(body);

groupBuilder1->Commit();
groupBuilder1->Destroy();

 

标签:body,added1,objectsTag,加入,创建,workPart,NXOPEN,NXOpen,groupBuilder1
来源: https://www.cnblogs.com/nx10/p/15101708.html