Accessing setDefaultFiberLength() in GUI scripting

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
John Olthoff
Posts: 14
Joined: Sun Sep 06, 2015 6:56 pm

Accessing setDefaultFiberLength() in GUI scripting

Post by John Olthoff » Thu Feb 04, 2016 12:50 pm

So I'm trying to set the default fiber length in the GUI, but I can't seem to access the ActivationFiberLengthMuscle class. I'm new to casting, so maybe I did it wrong... but I also can't access the constructor for that class.

Here's a relevant thread, but I can't make sense of it: https://simtk.org/forums/viewtopic.php? ... ngth#p7734

The best I can figure is that I might have to use a Millard2012 Muscle instead of a Thelen2003 Muscle.

Any help would be greatly appreciated!

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Accessing setDefaultFiberLength() in GUI scripting

Post by jimmy d » Tue Mar 01, 2016 8:45 am

I can get access to a Thelen2003Muscle using the below code. If you replace Thelen2003Muscle with the Millard type then you should be good to go.

Code: Select all


model = modeling.Model("gait2392.osim")
force = model.getMuscles().get("tfl_r")
muscle = modeling.Thelen2003Muscle.safeDownCast(force)
muscle.setDefaultFiberLength(x)


POST REPLY