AnsweredAssumed Answered

How to update data about ISimulationMotorFeatureData in motionstudy

Question asked by 克 争 孙 on Feb 23, 2016
Latest reply on Sep 20, 2016 by Orlando Gómez

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@

Outcomes