Page 1 of 1

run Script with windows command line

Posted: Mon Dec 09, 2013 7:31 am
by uschulz
Hi
I have some problems with running a "py"- script form the windows command line!

I have a fullbodymodel which I scale with a measurementset file. Afterwards I load a motion with joint angles.
My aim is to have a plot which shows the "muscle-fibre length" over the time of the motionfile.
I wrote a Script, which works correctly in the GUI.
But now i have the problem that it doesn't work on the API.

At first on my script I load a Model with loadModel()
the Error that occur is "function loadModel is unknown"

I think I have to set a Classpath form a package.
I tried it with import.org.opensim.untils --> but the same result

i would be very thankful if someone could help me!

best regards
Ursula Schulz

Re: run Script with windows command line

Posted: Fri Dec 13, 2013 10:44 am
by aymanh
Hi Ursula,

If the script contains only calls to the OpenSim API (modeling.* objects) then it should run from the command line python. If, however, the script uses funcions from the GUI (e.g. plotting/viewing/loading etc.) as appears to be the case then I don't expect it to execute from the command line since the implementation of these functions relies on other parts of the application and so is not self contained and is not accessible from command line.

We're working on enabling pure python wrapping, that would allow you to use the OpenSim API to compute values then use other open source python tools to do plotting and other processing on your own. If you're interested in using this approach please let me know and I'll add you as a beta tester so you can try it out as soon as it's available.

Hope this explains.
-Ayman