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!
Accessing setDefaultFiberLength() in GUI scripting
- John Olthoff
- Posts: 14
- Joined: Sun Sep 06, 2015 6:56 pm
Re: Accessing setDefaultFiberLength() in GUI scripting
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)