NX二次开发源码:查找当前工作部件所有的圆柱表面代码
NX二次开发源码:查找当前工作部件所有的圆柱表面代码static void do_ugopen_api()
{
Session *theSession = Session::GetSession();
Part *workPart = theSession->Parts()->Work();
BodyCollection *bc = workPart->Bodies();
ListingWindow *lw = theSession->ListingWindow();
int count = 0 ;
// get the body then to get the faces
for(BodyCollection::iterator it = bc->begin();it!=bc->end();it++)
{
Body *body = (*it);
// get faces
std::vector<Face*> faces = body->GetFaces();
for(int j =0 ; j <faces.size();j++)
{
Face *face = faces;
if ( face->SolidFaceType()==Face::FaceTypeCylindrical)
{
face->Highlight();
count++;
}
}
}
lw->Open();
char msg;
sprintf(msg,"The Cylinder faces count is :%d\n",count);
lw->WriteLine(msg);
}
<p> </p>
牛啊,就是复制乱码
页:
[1]