Removing a body from model using Python

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Cai Birch
Posts: 31
Joined: Tue Jan 02, 2018 7:40 am

Removing a body from model using Python

Post by Cai Birch » Mon Jan 28, 2019 8:02 am

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.

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Removing a body from model using Python

Post by Dimitar Stanev » Tue Jan 29, 2019 2:14 am

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

POST REPLY