Output file for selected muscle forces


in the tutorial and several posts an approach is mentioned to save muscle forces within a h5-file. This file includes the calculated muscle forces of all muscles and other data for each nstep. Caused by the size of the file a phyton or matlab routine is recommended to handle the data.

As I only need some selected muscles forces/activities for my investigation and I have a lot of trails (360) to analyse, I am looking for a less sophisticated way to get the muscle forces. Actually I am using AnyChart to get the results. I intend to simplify this process by using an AnyOutputFile.

Is it possible to create an AnyOutputFile including these muscles forces?


A short answer is “yes” :slight_smile:

Muscle force will be written for each time step and you can configure your output file to contain some additional information if needed. I think it is easiest to try and see how it works.


Hi Pavel,

thanks for your quick answer.

I have already tried to configure the output file with the following code, located in the study:

   AnyOutputFile test =

FileName = "test.csv";

AnyFloat Biceps= Main.Study.Output.Model.HumanModel.Right.ShoulderArm.Mus.biceps_brachii_caput_breve.Fm;

Using this code I get the error message

ERROR(SCR.PRS9) : C:/U..s/t..9/D..p/M..l/M..s/P..p/PushUp.main.any(82) : 'Model' : Unresolved object
Model loading skipped

For other output data like coordinates the code works well. Attached you find my model based on the "PushUp"-Model.

How do I have to configure the output file to get muscle forces?

Thanks in advance!



Study.Output is a special folder (AnyOutputFolder class) and there is something different about it. I think it only reflects the values from the actual model, but cannot be accessed for assigning values through this link. I will ask my colleagues if that is the case, but for now as a fix you can use the path to the actual model and object:

      AnyFloat Biceps= Main.HumanModel.BodyModel.Right.ShoulderArm.Mus.biceps_brachii_caput_breve.Fm;


Hi Pavel,

your advice works very well, but I have one more question.

Is it possible to select multiple forces, like in AnyChart:

Main.HumanModel.BodyModel.Right.ShoulderArm.Mus.*.Fm; ???

Kind regards,

Hi Stefan,

You could use a search function something like:

AnyObjectPtrArray searchresult = arrcat(ObjSearch("Main.somepathhere.*","AnyMechObject"),

You may not be able to use these values objects directly in the output, but you can do this search once and copy all the names in one go from the model tree and description windows to tune your output.