Page 1 of 1

delete or modify force after addforce

Posted: Fri Jun 22, 2018 11:50 pm
by ostr1969
how do i delete force added with model.addforce?
how do i modify it?

Re: delete or modify force after addforce

Posted: Sat Jun 23, 2018 2:47 pm
by tkuchida
how do i delete force added with model.addforce? how do i modify it?
You can retrieve/remove the item from the Model's ForceSet.

Code: Select all

myForce = myModel.updForceSet().get(index);
myModel.updForceSet().remove(index);
See https://simtk.org/api_docs/opensim/api_ ... ceSet.html.