怡宁塑胶模具设计

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

VS2010 NX8.5

 

std::vector<Face *> getadjacentFace(Face *Adjacentface); //相邻面

 

std::vector<Face *> HoleTable::getadjacentFace(Face *Adjacentface) //相邻面
{
try
{
std::vector<Edge *> selectfaceEdge; //边容器
std::vector<Face *> AdjacentAllFace; //面容器
std::vector<Face *> AdjacentAllFace1; //面容器
selectfaceEdge.clear();
AdjacentAllFace.clear();

selectfaceEdge=Adjacentface->GetEdges();
theSession->ListingWindow()->WriteLine("边的数量"+intToNXString(selectfaceEdge.size()));
for( int i = 0 ; i < selectfaceEdge.size();i++)
{
Edge *AdjacentEdge1 = selectfaceEdge[i];
AdjacentAllFace1.clear();
AdjacentAllFace1=AdjacentEdge1->GetFaces();
theSession->ListingWindow()->WriteLine("面的数量"+intToNXString(AdjacentAllFace1.size()));
for( int j = 0 ; j < AdjacentAllFace1.size();j++)
{
Face *Adjacentface1 = AdjacentAllFace1[j];
if(Adjacentface->Tag() != Adjacentface1->Tag())
{
AdjacentAllFace.push_back(Adjacentface1);
theSession->ListingWindow()->WriteLine("面的TAG"+intToNXString(Adjacentface1->Tag()));
Adjacentface1->Highlight();
}
}
}

return std::vector<Face *> (AdjacentAllFace);

}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
HoleTableOrigin::theUI->NXMessageBox()->Show("相邻面", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}

posted on 2021-04-22 20:03  怡宁塑胶模具设计  阅读(411)  评论(0编辑  收藏  举报