Add Description to Resultfile with python macro

Started by Mark, May 15, 2024, 09:04:26 AM

Previous topic - Next topic

Mark

Hello,
I would like to add a description to a result file (FlowDict and Filterdict). I run the modules with a Python macro. Is it possible to define a description in the args dictionary? If not, how can I define the description after the run?

Best regards
Mark

Janine Hilden

Hello Mark,

you can change the result file from Python after the generation using the stringmap package. This package is described in the GeoPy scripting User Guide in the chapter "Access to GeoDict result files (*.gdr)" on page 81.
https://www.math2market.com/fileadmin/UserGuide/GeoDict2024/Automation2024.pdf

I give you a short example code to change the description in the metadata tab of a FlowDict result viewer:


import stringmap
gdr=stringmap.parseGDR('StokesResult.gdr')
GDR_Description=gdr['Description']
gdr['Description']='some text\n'+GDR_Description
gdr.toFile('new.gdr')


Find the needed keys for the result part to change by printing the gdr in the console print(gdr)

Best regards,
Janine

Mark

Hello Janine,
thank you very much for your reply. It works perfectly. I just noticed that the comments are lost in the saved result file and the formatting is slightly changed.

Best regards
Mark