GeoDict Forum
GeoDict Modules and their functionality => Basic functionality and features (GeoDict Base Package) => Topic started by: FabianeGommes on September 11, 2023, 02:47:58 PM
-
Hello,
I'm having difficulty accessing the value of the 'YoungModulus' in the ResultMap.
I'm using the code presented below, but it gives an error on the line "young_modulus = float(gdr['ResultMap']['Strain']['Isotropic']['YoungModulus'])".
....
gdr_name = gd.runCmd("ElastoDict:SolveFeelMathVOX", SolveFeelMathVOX_args_1, Header['Release'])
import stringmap
young_modulus = gdr['Strain']['Isotropic']['YoungModulus']
gd.msgBox(young_modulus)
May I suggest another way? My code aims to perform an optimization, which will be based on the 'YoungModulus'.
-
Dear Fabiane,
in order to access a gdr from GeoPy you first have to parse the gdr:
import stringmap
gdr = stringmap.parseGDR("PathToGDRFile")
When the gdr was parsed you then can access the information for example the young's modulus:
young_modulus = gdr.getDouble('ResultMap:Strain:Isotropic:YoungModulus')
Further details can be found in our GeoPy User Guide https://www.math2market.com/fileadmin/UserGuide/GeoDict2023/Automation2023.pdf on page 70
-
Now it works, thank you very much