Page 1 of 1

Export ScaleTool setting xml

Posted: Tue Sep 08, 2020 5:32 am
by pwesberg
Hello,

Using python API for scaling, I
1. generate an scale tool instance by loading an generic scale_settings.xml
2. than set some specific values (i.e. ScaleTool.getModelScaler().setOutputModelFileName('output_model_name')
3. run the scale tool.

For some reason (i.e. documentation) I'ld like to export the manipulated scale_settings.xml from 2. step.

The scaletool function I've found so far print the scale factors to a xml file,

Code: Select all

ScaleTool.print('setup_scale.xml')
ScaleTool.getModelScaler().setOutputScaleFileName()
ScaleTool.setPrintResultFiles()
... but they do not print the scale settings to xml. Is there any method you recommend?

Re: Export ScaleTool setting xml

Posted: Sat Sep 12, 2020 6:03 pm
by ongcf
I think this is a specific issue with Python, because it has its own "print" function. To get around this, we rename the function "printToXML()". I'd try replacing your first line with "printToXML". The next two lines are functions that take one input argument. Our doxygen pages on those can be helpful to know what inputs are needed:
https://simtk.org/api_docs/opensim/api_ ... caler.html
https://simtk.org/api_docs/opensim/api_ ... eTool.html