Advertisement
ShadowSparow

Поиск

Dec 15th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1.  
  2. // Поиск номера face:
  3.  
  4. SelectSet *pSelect;
  5. pPartDoc->get_SelectSet(&pSelect); // SelectSet->Count();
  6. int seeknumber = -1;
  7. if (pSelect->GetCount() > 0)
  8. {
  9. FacePtr Seekface = pSelect->GetItem(1);
  10.  
  11. for (int i = 1; i <= pPartComDef->SurfaceBodies->GetCount(); i++)
  12. {
  13. SurfaceBody *SurfBody;
  14. SurfaceBodies *SurfBodies;
  15.  
  16. pPartComDef->get_SurfaceBodies(&SurfBodies);
  17.  
  18. SurfBodies->get_Item(i, &SurfBody);
  19.  
  20. Face *face;
  21. Faces *faces;
  22.  
  23. SurfBody->get_Faces(&faces);
  24.  
  25. //int N = SurfBody->Edges->GetCount();
  26. for (int j = 1; j <= SurfBody->Faces->GetCount(); j++)
  27. {
  28. faces->get_Item(j, &face);
  29.  
  30. if (Seekface == face)
  31. {
  32. seeknumber = j;
  33. }
  34. }
  35. }
  36. }
  37. CString str;
  38. str.Format(_T("%i"), seeknumber);
  39. MessageBox(str);
  40.  
  41.  
  42.  
  43.  
  44. // Поиск номера edge
  45.  
  46. SelectSet *pSelect;
  47. pPartDoc->get_SelectSet(&pSelect); // SelectSet->Count();
  48. if (pSelect->GetCount() > 0)
  49. {
  50. EdgePtr Seekedge = pSelect->GetItem(1);
  51. int seeknumber = -1;
  52. for (int i = 1; i <= pPartComDef->SurfaceBodies->GetCount(); i++)
  53. {
  54. SurfaceBody *SurfBody;
  55. SurfaceBodies *SurfBodies;
  56.  
  57. pPartComDef->get_SurfaceBodies(&SurfBodies);
  58.  
  59. SurfBodies->get_Item(i, &SurfBody);
  60.  
  61. Edge *edge;
  62. Edges *edges;
  63.  
  64. SurfBody->get_Edges(&edges);
  65.  
  66. int N = SurfBody->Edges->GetCount();
  67. for (int j = 1; j <= SurfBody->Edges->GetCount(); j++)
  68. {
  69. edges->get_Item(j, &edge);
  70.  
  71. if (Seekedge == edge)
  72. {
  73. seeknumber = j;
  74. }
  75. }
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement