Hi, I am struggling to get and update fixed points for muscle paths in python.
When using model.getMuscleList().getPathPointSet() I get an error "'AbstractPathPoint' object has no attribute 'get_location' ". I also cannot reach the vector value when running
state = model.initSystem()
loc = model.getMuscles().get(0).getGeometryPath().getPathPointSet().get(0).getLocation(state)
Can you help?
get location for muscle does not work in python
- Ekaterina Stansfield
- Posts: 9
- Joined: Mon Jul 03, 2017 5:37 am
Re: get location for muscle does not work in python
Hi Ekaterina,
Try the following to get XYZ locations of the origin
Dan
Try the following to get XYZ locations of the origin
Code: Select all
state = model.initSystem()
muscle0 = model.getMuscles().get(0)
origin_x = muscle0.getGeometryPath().getCurrentPath(state).get(0).getLocation(state).get(0)
origin_y = muscle0.getGeometryPath().getCurrentPath(state).get(0).getLocation(state).get(1)
origin_z = muscle0.getGeometryPath().getCurrentPath(state).get(0).getLocation(state).get(2)
- Ekaterina Stansfield
- Posts: 9
- Joined: Mon Jul 03, 2017 5:37 am
Re: get location for muscle does not work in python
Thanks Dan. I'll give it a go. How can I update these XYZ?
is this right?
for i in range(0,3):
val = loc.get(i)
val = val + 1
loc.set(i, val)
K
is this right?
for i in range(0,3):
val = loc.get(i)
val = val + 1
loc.set(i, val)
K