NXOpen测量柱面两条边的最近距离

 

#include <NXOpen/MeasureDistanceBuilder.hxx>
#include <NXOpen/MeasureManager.hxx>
#include <NXOpen/SelectDisplayableObject.hxx>
#include <NXOpen/SelectDisplayableObjectList.hxx>
#include <NXOpen/Unit.hxx>
#include <NXOpen/UnitCollection.hxx>
#include <NXOpen/MeasureDistance.hxx>
#include <NXOpen/MeasureDistanceBuilder.hxx>

 

 

   NXObject *nullNXObject(NULL);
   MeasureDistanceBuilder *measureDistanceBuilder1;
   measureDistanceBuilder1 = workPart->MeasureManager()->CreateMeasureDistanceBuilder(nullNXObject);
   measureDistanceBuilder1->SetMtype(MeasureDistanceBuilder::MeasureTypeMinimum);
   Edge *edge1(dynamic_cast<Edge *>(NXObjectManager::Get(edges[0]->Tag())));
   measureDistanceBuilder1->Object1()->SetValue(edge1);
   Edge *edge2(dynamic_cast<Edge *>(NXObjectManager::Get(edges[1]->Tag())));
   measureDistanceBuilder1->Object2()->SetValue(edge2);
   measureDistanceBuilder1->SetInfoWindow(true);
   Unit *unit1(dynamic_cast<Unit *>(workPart->UnitCollection()->FindObject("MilliMeter")));
   MeasureDistance *measureDistance1;
   measureDistance1 = workPart->MeasureManager()->NewDistance(unit1, MeasureManager::MeasureTypeMinimum, edge1, edge2);
   measureDistance1->Information();
   measureDistance1->MeasurementType();
   delete measureDistance1;
   measureDistanceBuilder1->Destroy(); 

 

NXOpen测量柱面两条边的最近距离

 

上一篇:我用Python写了一款监视老板的软件!这才是上班摸鱼的最高境界!


下一篇:20 个强大的 Sublime Text 插件