Add Description to Resultfile with python macro

· 2 · 14
*

Mark

  • *
  • Posts: 1
    • View Profile
Add Description to Resultfile with python macro
« on: Today at 09:04:26 AM »
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

*

hilden

  • *****
  • Posts: 6
    • View Profile
Re: Add Description to Resultfile with python macro
« Reply #1 on: Today at 12:46:12 PM »
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:

Code: [Select]
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
Code: [Select]
print(gdr)
Best regards,
Janine