|
Navigation: GeoDict 2025 - User Guide > Automation > GeoPy Scripting > Advanced Scripting |
Scroll |
Create Custom Result Files
GeoDict includes an API to create custom result files (*.gdr). This is particularly useful, if the same workflow is repeated often with different parameters in an automatic parameter study and the results should be presented in the GeoDict Result Viewer. In this way, the library gdr provides a simple possibility to compare the results as desired. For more details about result files refer to the Result Viewer User Guide.
The gdr library is loaded at the beginning of a Python file with the command from gdr import GDR and contains the following commands:
Creates an empty *.gdr file and a result folder with the given name. Start with this command to create a custom GeoDict result file already containing input map, log map, post map and results tabs. Additionally, the GeoDict project folder is changed to the result folder automatically. Input:
Example:
|
Saves the results to the result file. Define a result map and the report. This command saves the result file with all settings defined by the commands shown in this chapter used in the lines between createEmptyResults and saveResults. Input:
Example:
|
Saves the currently loaded structure file to the result folder and adds a geometry map to the result file allowing to load the structure via the Load Structure button in the result file and showing a green dot if the structure is loaded. Input:
Example:
![]() |
Replaces the default description “Created by macro 'macro file path'.” by a custom description in the Metadata tab of the generated result file. Input:
Example:
![]() |
Adds a custom Command name to the generated result file. The command name must be given as a string, and consists of a name for the module, a colon (:), and a name for the solver. The command name can for example be viewed in the Module and Command columns in the top of the Result Viewer. Input:
Example:
![]() |
Adds a plot to the result file with the given plot title, labels, units, values and the graph title. For each new plot added, a new subtab is created in the Plots tab of the Results tab. Input:
Example:
|
Adds a graph to one of the created plots. Enter the X- and Y- values and the graph title. Input:
Example:
![]() |
Adds text in the Result – Report subtab of the generated result file. With this command several lines of text can be added and also text can be placed between tables or images added with the commands addTable and addImage, while the text inserted in the saveResults command always is placed at the end of the report. Input:
Example:
![]() |
Adds titles in the Result – Report subtab of the generated result file. This is a similar to the addText command, but with bold font. Input:
Example:
![]() |
Adds table to the Results – Report subtab of the generated result file. Input:
Example:
![]() |
Adds an image to the Results – Report subtab of the generated result file. Additionally, the image is saved to the corresponding result folder. Input:
Example:
![]() |
Adds content to the Input Map tab of the generated result file. The input map by default already contains the entries ResultFileName and MacroFilePath. The content for the Python dictionary to add can be chosen as desired. Input:
Example:
![]() |
Adds entries to the Log Map tab of the generated result file. By default the result file already contains information about the system on which the macro is run. Input:
Example:
![]() |
For experienced users, defining all plot parameters manually by adding a Post Map creates a Plot subtab to the Results tab of the generated result file. In most cases, however, it is recommend to add plots via the addPlot and addGraphToPlot commands. In the following example find the keys, that must be given to obtain a plot. For more possible keys refer to Post Map tabs in usual GeoDict simulation result files. Input:
Example:
|
Adds parameters to the Parameter Map in the Metadata tab of the generated result file. By default, the map already contains the entries MacroFilePath and NumberOfVariables. The content for the Python dictionary can be chosen as desired. Input:
Example:
|
For advanced users. Adds explicitly given Geometry data to the generated result file. In most cases it is recommended to use the addGeometry command instead to generate the needed data automatically from the currently loaded structure. The Geometry map must be given correctly. Then loading the corresponding structure file to GeoDict leads to a green dot in the result viewer. If the structure also is saved to the result folder, a Load Structure button appears in the result file. The geometry Python dictionary must contain the keys shown in the following example. If the structure is in memory, the corresponding values can be contained with GeoPy API functions as shown. Input:
Example:
|
Note! When using .update on a map, the current content of the map is kept and the content of your custom map is added below. If you want to replace it with your custom map, instead of .update(newmap) use = newmap. |
©2025 created by Math2Market GmbH / Imprint / Privacy Policy
