The second study in AnyPyTool

I defined two studies in my main file, and both studies can run InverseDynamics in anybody software. But when I wanted to use AnyPyTool, one of them worked fine with InverseDynamics, while the other didn't.
from anypytools import AnyMacro, AnyPyProcess, macro_commands as mc
Below is my code.
macro_list = [
[
mc.Load("SpinePressureStanding.Main.any"),
# mc.SetValue("Main.MyModel.PatellaLigament.DriverPos", 0.02 + i * 0.01),
mc.OperationRun("Main.MyStudy.InverseDynamics"),
# mc.Dump("Main.MyStudy.Output.Abscissa.t"),
# mc.Dump("Main.Study.Output.MaxMuscleActivity"),
# mc.Dump("Main.MyModel.PatellaLigament.DriverPos"),
]
]

app = AnyPyProcess()
results = app.start_macro(macro_list)

Pycharm reports an error:
D:\tool\conda\python.exe D:\work\AMMR.v2.3.0-Demo\Application\Validation\WilkeSpinalDiscPressure\SpinePressureStanding\main.py
100%|██████████| 1/1 [00:03<00:00, 3.51s/it]Failed (i=0) : 3.5 sec : wilkespinaldiscpressure-spinepressurestanding-0_(oyipb1fr).txt
Completed: 0, Failed: 1
100%|██████████| 1/1 [00:03<00:00, 3.56s/it]

Process finished with exit code 0

The error file reads:
Configuring model...
Evaluating model...
Loaded successfully.
Elapsed Time : 2.820000

Macro command > operation Main.MyStudy.InverseDynamics

Error : Main.MyStudy.InverseDynamics : Unresolved object.

Closing model...
Saving modified values...
Deleting loaded model...
...Model deleted.

Hi,

You can see what went wrong in the log file:
wilkespinaldiscpressure-spinepressurestanding-0_(oyipb1fr).txt

Kind regards,
Pavel

Hi,
What went wrong in the log file:
wilkespinaldiscpressure-spinepressurestanding-0_(oyipb1fr).txt
is shown below:

Configuring model...
Evaluating model...
Loaded successfully.
Elapsed Time : 2.820000

Macro command > operation Main.MyStudy.InverseDynamics

Error : Main.MyStudy.InverseDynamics : Unresolved object.

Closing model...
Saving modified values...
Deleting loaded model...
...Model deleted.
[/quote]

Oops, sorry, it was a long day :slight_smile:

Yeah, the problem is that you don't have an object called Main.MyStudy.InverseDynamics apparently - hence the Unresolved Object. Check if your study is called MyStudy and whether it is an actual AnyBodyStudy object.

Kind regards,
Pavel

Hi,
Turns out I confused my file location ... Thank you for your patience and advice.

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.