CAM更改起始直径为直径

    Session* theSession = Session::GetSession();
    Part* workPart(theSession->Parts()->Work());
    UI* theUI = UI::GetUI();

    CAM::CylinderMillingBuilder* cylinderMillingBuilder1;
    cylinderMillingBuilder1 = workPart->CAMSetup()->CAMOperationCollection()->CreateCylinderMillingBuilder(dynamic_cast<CAM::CylinderMilling*>(theUI->SelectionManager()->GetSelectedTaggedObject(0)));

    CAM::HoleMachiningCutParameters* holeMachiningCutParameters1;
    holeMachiningCutParameters1 = cylinderMillingBuilder1->CuttingParameters();

    CAM::FBM::FeatureGeometry* featureGeometry1;
    featureGeometry1 = cylinderMillingBuilder1->GetFeatureGeometry();

    CAM::FBM::MachiningFeatureGeometry* machiningFeatureGeometry1(dynamic_cast<CAM::FBM::MachiningFeatureGeometry*>(featureGeometry1));
    CAM::GeometrySetList* geometrySetList1;
    geometrySetList1 = machiningFeatureGeometry1->GeometryList();

    for (int i = 0; i < geometrySetList1->Length(); i++)
    {
        CAM::FBM::FeatureSet* featureSet;
        featureSet = machiningFeatureGeometry1->GetFeatureSet(i);
        CAM::FBM::Feature* feature;
        feature = featureSet->GetFeature();
        feature->OverrideAttributeValue("START_DIAMETER", feature->GetAttributeDoubleValue("DIAMETER_1"));
        //p(feature->GetAttributeDoubleValue("DIAMETER_1"));//直径

        p(feature->GetAttributeDoubleValue("START_DIAMETER"));//起始直径
    }
    NXObject* nXObject1;
    nXObject1 = cylinderMillingBuilder1->Commit();
    cylinderMillingBuilder1->Destroy();

posted @ 2021-03-13 21:10  老婆饼里有老婆  阅读(183)  评论(0编辑  收藏  举报