double Dis_faceFaec(tag_t Obj1, tag_t Obj2)//测量距离
{
NXOpen::Session *theSession = NXOpen::Session::GetSession();
NXOpen::Part *workPart(theSession->Parts()->Work());
NXOpen::Part *displayPart(theSession->Parts()->Display());
NXOpen::NXObject *nullNXOpen_NXObject(NULL);
NXOpen::MeasureDistanceBuilder *measureDistanceBuilder1;
measureDistanceBuilder1 = workPart->MeasureManager()->CreateMeasureDistanceBuilder(nullNXOpen_NXObject);
measureDistanceBuilder1->SetMtype(NXOpen::MeasureDistanceBuilder::MeasureTypeMinimum);
//measureDistanceBuilder1->SetInfoWindow(true);
//NXOpen::Features::Brep *brep1(dynamic_cast<NXOpen::Features::Brep *>(workPart->Features()->FindObject("UNPARAMETERIZED_FEATURE(290)")));
NXOpen::Face *face1(dynamic_cast<NXOpen::Face *>(NXOpen::NXObjectManager::Get(Obj1)));
measureDistanceBuilder1->Object1()->SetValue(face1);
NXOpen::Face *face2(dynamic_cast<NXOpen::Face *>(NXOpen::NXObjectManager::Get(Obj2)));
measureDistanceBuilder1->Object2()->SetValue(face2);
NXOpen::Unit *unit1(dynamic_cast<NXOpen::Unit *>(workPart->UnitCollection()->FindObject("MilliMeter")));
NXOpen::MeasureDistance *measureDistance1;
measureDistance1 = workPart->MeasureManager()->NewDistance(unit1, NXOpen::MeasureManager::MeasureTypeMinimum, false, face1, face2);
//measureDistance1->Information();
//获得距离
double Distance = measureDistance1->Value();
delete measureDistance1;
return Distance;
}