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:
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).
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.
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.
Finally, gd.runCmd executes the command. This function is a GeoDict API command and needs three input values: