NXOpen 选面找相邻面

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

怡宁塑胶模具设计
原文地址:https://www.cnblogs.com/hqsalanhuang/p/14691294.html