怡宁塑胶模具设计

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

 

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

 

 

posted on 2021-02-28 20:27  怡宁塑胶模具设计  阅读(276)  评论(0编辑  收藏  举报