Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
Marcos Alfredo Núñez
- Posts: 22
- Joined: Thu Sep 01, 2016 1:41 pm
Post
by Marcos Alfredo Núñez » Thu Feb 08, 2018 3:01 pm
Hi! I'm using the 3.3 API with python. This example:
Code: Select all
import opensim
m = opensim.Model()
a = opensim.MuscleAnalysis()
m.addAnalysis(a)
throws:
Code: Select all
/usr/local/lib/python2.7/dist-packages/opensim-3.3-py2.7.egg/opensim/opensim.pyc in addAnalysis(self, analysis)
69848 val = _opensim.Model_addAnalysis(self, analysis)
69849
> 69850 args[0]._markAdopted()
69851
69852
NameError: global name 'args' is not defined
Any idea as to why? Is there a workaround for this? The idea is to append a bunch of Analyses to a Model and then feed it to an AnalyzeTool.
-
Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Post
by Christopher Dembia » Thu Feb 08, 2018 3:34 pm
This results from using a version of SWIG that is too recent. Try using SWIG 3.0.2. Or, you have to edit the opensim.py file that SWIG generates: replace "args[0]" with "analysis".
This issue is fixed in the 4.0 code base.
-
Marcos Alfredo Núñez
- Posts: 22
- Joined: Thu Sep 01, 2016 1:41 pm
Post
by Marcos Alfredo Núñez » Thu Feb 08, 2018 4:00 pm
Yep, that's it. I just tried it on a Windows machine with a release install of OpenSIM and works fine. I guess the switch to 4.0 is becoming more and more of a necessity. I'll give it a thought once the compiling instructions for the GUI in Linux are available
By the way, that was opensim.pyc, and in the opensim.py from the same folder I could not find a single mention to "args[0]". Strange...
Thank you very, very much!