其他分享
首页 > 其他分享> > NX二次开发-测量面积

NX二次开发-测量面积

作者:互联网

// 精度=0.9999
int  MyObject::FACE_ask_area(tag_t face, double value[2])
{
    int errorCode = 0;
    double Area = 0.00;
    double Perimeter = 0.00;
    try
    {
        std::vector<NXOpen::IParameterizedSurface *> objects;
        objects.push_back(dynamic_cast<NXOpen::IParameterizedSurface *>(NXObjectManager::Get(face)));
        NXOpen::MeasureFaces *measureFaces1 = workPart->MeasureManager()->NewFaceProperties(NULL, NULL, 0.9999, objects);
        Area = measureFaces1->Area();
        Perimeter = measureFaces1->Perimeter();
        delete measureFaces1;
    }
    catch (exception& ex)
    {
        errorCode = 1;
    }
    value[0] = Area;
    value[1] = Perimeter;
    return errorCode;
}

 

标签:Perimeter,errorCode,Area,double,测量,NX,objects,二次开发,measureFaces1
来源: https://www.cnblogs.com/t2001/p/16358640.html