Page 1 of 1

Removing a body from model using Python

Posted: Mon Jan 28, 2019 8:02 am
by 00ocai
I have a full body model that I would like to edit via python. I can get handles to bodysets, muscles, etc but can't figure out how to remove a component from the model...I'd like to remove the body's/joints/muscles etc for the left leg. Ofc, It's possible to edit the xml file but I'd like to do everything via Python.

Re: Removing a body from model using Python

Posted: Tue Jan 29, 2019 2:14 am
by mitkof6
You can use the remove function. But you will need to remove the corresponding joints, constraints and other model elements that refer to the body. For example, may be muscles that are attached to the removed body.

https://simtk.org/api_docs/opensim/api_ ... 294b032d55