2 Replies Latest reply on Sep 20, 2016 11:20 PM by Orlando Gómez

    How to update data about ISimulationMotorFeatureData in motionstudy

    克 争 孙

      Hi,

      I am working on a robotic motion simulation addin. After I get ISimulationMotorFeatureData interface through IMotionStudy->GetMotionFeatures; IFeaatur->GetDefinition, I modify the motor data through LoadSplineData. I update the modified data through IModifyDefinition2, it didn't work .

      ...

      long featureCount = 0;

        VARIANT features;

        LPDISPATCH motorDispatch;

        pMotionStudy->GetMotionFeaturesCount(&featureCount);

        pMotionStudy->GetMotionFeatures(&features);

       

        CComPtr<ISimulationMotorFeatureData> motorFeature;

        VARIANT_BOOL loadDataSuccess = VARIANT_FALSE;

        CComPtr<IFeature> feature;

        LPDISPATCH definition;

        ::SafeArrayGetElement(features.parray, &index, &motorDispatch);

        motorDispatch->QueryInterface(__uuidof(IFeature), (void**)&feature);

        feature->GetDefinition(&definition);

        VARIANT_BOOL updated = VARIANT_FALSE;

        definition->QueryInterface(__uuidof(ISimulationMotorFeatureData), (void**)&motorFeature1);

        motorFeature1->LoadSplineData(fileName1, &loadDataSuccess);

        rest = feature->IModifyDefinition2(motorFeature1, pModelDoc2, pComponent2, &updated);Motion Studies@