AnsweredAssumed Answered

How to get information from an Animation with MotionStudyResult  GetLinearVelocity

Question asked by Hans Björk on Jul 25, 2017
Latest reply on Jul 27, 2017 by Hans Björk

I have a simple assy with an Animation that moves a few components.


I try to get motion data from the animation with GetLinearVelocity, but I get only vectors of { 0.0, 0.0, 0.0 }.

The code looks something like (c++):

CComPtr<IMotionStudyResults> pResults = NULL;

hRes = pMotionStudy->GetResults( lStudyType, & pResults );


hRes = theRootComp->GetChildren( & vChildren );


// Iterate over the children of the root component of the ModelDoc, and over the duration of the animation

CComPtr<IComponent2> pComp;  // From theRootComp->GetChildren( & vChildren ); above

double dRequestedTime; // Iterator, increase in small steps in the duration of the animation

hRes = pResults->GetLinearVelocity( dRequestedTime, pComp, &pReturnVV );


The returned MathVector in pReturnVV is always { 0.0, 0.0, 0.0 }. I get no error codes.


Anyone has any idea what I'm doing wrong?