Please enable JavaScript to view this site.

GeoDict User Guide 2025

Structure of a GeoPy Macro

GeoPy (GeoDict Python) macros are scripts running a sequence of commands, even from different licensed modules. Their suffix is .py and they consist of (at least) four blocks:

  1. Header = {} contains general information with comments on the release, recording time, the recorder or creator and the system used.
  2. Description = ''' ''' is automatically generated and, before any editing or adding of information, it simply describes the GeoDict version used for recording the macro in the given time and date, and the licensee.
  3. Variables = {}. When called from the command line (or first level call), the default values for the variables in the *.py file are used. When called from the GeoDict GUI or from another *.py file (second level call), the default values are ignored. Detailed information can be found in Available Variable Types.
  4. The command block contains the commands to be executed by GeoDict.
AUTOMA~1_img2

Command Block

If Save macro results to new folder and Store general preferences in macro are checked in the Start Macro Recording dialog box, the block starts with GeoDict:CreateProjectFolder and the GeoDict:Preferences which are the settings entered in the settings dialog (Settings Settings… in the menu bar).

AUTOMA~1_img3

Afterward, the recorded commands can be found. For example, the key FiberGeo:Create commands the FiberGeo module to create a structure and to save it as GeoDict structure file (*.gdt).

The command parameters are given in a Python dictionary assigned to a variable called commandname_args e.g. Create_args for the FiberGeo Create command. Find all parameters from the GUI in this dictionary given in key : value pairs.

For example, the 'Domain' : {} parameters in the Create_args_1 parameters define the periodicity, spatial location (origin), voxel length, and size (NX, NY, NZ) of the structure. After this, the macro continues with the parameters for grammage, overlapping settings, random seed, isolation distance, etc.

AUTOM_structureofmacro_gui

Because, in this case, two different materials (both Infinite Circular Fibers) are used in the structure, 'Generator1' and later 'Generator2' are called. For these objects the parameter values for 'Material', the 'DiameterDistribution', and the 'OrientationDistribution' of both materials are given.

AUTOMA~1_img8

Finally, gd.runCmd executes the command. This function is a GeoDict API command and needs three input values:

  • GeoDict command, here FiberGeo:Create,
  • command parameters usually defined above and assigned to a variable, here Create_args_1,
  • release year, usually given by the header.

©2025 created by Math2Market GmbH / Imprint / Privacy Policy