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 motorFeature;

  VARIANT_BOOL loadDataSuccess = VARIANT_FALSE;

  CComPtr 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);​@

SolidworksApi macros