Page 1 of 1

How to direct the MeasurementSet to a file in ScaleTool?

Posted: Sat Jun 12, 2021 1:37 am
by kernalnet
Hi,

I'd like to direct the MeasurementSet data is Scale setup file to an external file similar to this:
<MeasurementSet file="measurements.xml">
If I do it manually, it works well in OpenSim.

But I couldn't find something in python to set the file:

Code: Select all

scale = osim.ScaleTool()
scale.getModelScaler().getMeasurementSet().setFileName('measurements.xml')
I wonder if you would guide me how I can do it.

Regards,
Mohammadreza

Re: How to direct the MeasurementSet to a file in ScaleTool?

Posted: Sat Jun 12, 2021 5:41 am
by tkuchida
You might be able to do something like this:

Code: Select all

scale = osim.ScaleTool()
mset = osim.MeasurementSet('measurements.xml')
scale.getModelScaler().setMeasurementSet(mset)
https://simtk.org/api_docs/opensim/api_ ... eTool.html

Re: How to direct the MeasurementSet to a file in ScaleTool?

Posted: Sat Jun 12, 2021 6:06 am
by kernalnet
Dear Thomas,

Thanks for your reply. You are right.
I intended to make the setup file easier to understand for teaching purposes. You know, with "MeasurementSet"s and "IKTaskSet"s the setup file is so crowded.

I was wondering if you would tell me whether there is any other way to do in Python.

Best,
Mohammadreza