Navigation: GeoDict 2025 - User Guide > Automation > GeoPy Scripting > Advanced Scripting > GeoDict API |
Scroll |
Structure Functions
Get information about the currently loaded structure file, as for example size, voxel length, solid volume percentage and many more. Edit the structure and set the structure in GeoDict.
Gets the settings of the domain of the currently loaded geometry and returns it as a Python dictionary. This dictionary contains information about domain size, origin, voxel length, material of ID00, periodicity and overlap settings, if available. Input:
Example:
|
Returns a 3-tuple (nx,ny,nz) containing the size of the currently loaded geometry in number of voxels. Returns None if no geometry is present. This command can be assigned to individual variables in Python using tuple deconstructions as shown in the example. Input: None Example:
|
Returns the voxel length of the current structure in meters. Input: None Example:
|
Returns a list of the slice-wise voxel counts in the given direction for the given material ID. Returns None if no geometry is present. Input:
Example:
|
Returns a 256-element list of voxel counts for each color (material index) for the currently loaded geometry. Returns None if no geometry is present. Input: None Example:
|
Returns the solid volume fraction of the currently loaded geometry. Input: None Example:
|
Returns the positions of the currently selected voxels as a list of tuples (x,y,z). Note, that the positions returned with this command are not exactly the same, as given in the GUI. That is because the positions count starts with (0,0,0) for the command getSelectedVoxels and with (1,1,1) for the GUI. Input: None Example: For the following example a structure has to be loaded and one or more voxels must be selected:
|
Returns the currently loaded structure as a 3D 8-bit numpy array. Each entry corresponds to a voxel and contains its material ID (0-255). Input: None Example: The following example writes the currently loaded structure into a *.csv file, where the first row contains the volume dimensions nx, ny and nz, followed by rows each containing the voxel values along a single Z-row.
For example, the 3d numpy array [[[2, 1], [4, 3]], [[7, 5], [8, 6]]] of a 2x2x2 structure is written into a csv file structured as follows: ![]() |
This command has no return value but takes a 3D numpy array containing values between 0 and 255, defining the material ID of the described voxel, and sets it as GeoDict's current structure. This causes volume fields to be unloaded. Input:
Example: For example, if a 3D structure is saved as a *.csv file, structured in the same way as in the example for gd.getStructure above, this structure can be visualized in GeoDict with the gd.setStructure command:
|
Returns a string, containing the structure description of the currently loaded structure. The description is to be found in the title bar of GeoDict or in the Project Status Section on the left, when the Structure settings are unfolded. It displays how the geometry was generated or saved. ![]() Input: None Example: For an example, see underneath the setStructureDescription command. |
Sets the description text for the currently loaded structure. Input:
Example:
|
This function is deprecated, use gd.getStructureHash64 instead. |
Returns the new 64-bit structure hash (Structure ID) of the currently loaded structure as an integer. This can be used e.g. to determine if a GDR result file corresponds to a given structure. This is a more robust unique identifier than getStructureHash. Input: None Example:
|
Returns the structure file name of the currently loaded structure as a string. Input: None Example:
|
This command has no return value but updates the geometry renderer. Input: None |
©2025 created by Math2Market GmbH / Imprint / Privacy Policy