geosoft.gxpy.project submodule

Geosoft desktop project interface, which provides access to an active and open Geosoft desktop project.

Classes:
Geosoft_project the geosoft project

Note

Test example: geosoft project tests

class geosoft.gxpy.project.Geosoft_project

Bases: object

Use this class to interact with an open Geosoft project. This singleton class is available only from an extension running from an open Geosoft project.

current_3dv

the open geosoft_3dv that has current (or most recent) focus

current_database

the open database that has current (or most recent) focus

current_db_state()

Return the state of the current database.

Returns:dict of the current database state, {} of there is no current database.
‘disp_chan_list’ list of displayed channels
‘selection’ current selection as (line, channel, start_fid, end_fid)

New in version 9.2.

current_gmsys_2d

the open GM-SYS 2D model that has current (or most recent) focus

current_gmsys_3d

the open GM-SYS 3D model that has current (or most recent) focus

current_grid

the open grid that has current (or most recent) focus

current_map

the open map that has current (or most recent) focus

current_map_state()

Return the state of the current map.

Returns:dict of the current map state, {} if no current map.
‘current_view’ name of the current view
‘display_area’ (min_x, min_y, max_x, max_y) in units of the current view
‘3d_view_name’ if a 3D view, name of the view
‘point’ (x, y) of the current selection point
‘cursor’ (x, y) of the current cursor location

New in version 9.2.

current_voxel

the open voxel that has current (or most recent) focus

current_voxi

the open VOXI model that has current (or most recent) focus

menus

Oasis montaj menu information: (default_menus, loaded_menus, user_menus)

open_3dv

list of geosoft_3dv (3d views) open in a 3D viewer

open_databases

list of databases open as a database document

open_gmsys_2d

list of GM-SYS 2D models open as a document

open_gmsys_3d

list of GM-SYS 3D models open as a document

open_grids

list of grids open as a grid document

open_maps

list of maps open as a map document

open_voxels

list of voxels/voxettes open as a document

open_voxi_models

list of VOXI models open as a document

project_3dv

list of geosoft_3dv (3D views) in the project

project_databases

list of databases in the project

project_gmsys_2d

list of GM-SYS 2D models in the project

project_gmsys_3d

list of GM-SYS 3D models in the project

project_grids

list of grids in the project

project_maps

list of maps in the project

project_voxels

list of voxels/voxettes in the project

project_voxi_models

list of VOXI models in the project

exception geosoft.gxpy.project.ProjectException

Bases: Exception

Exceptions from geosoft.gxpy.project.

New in version 9.1.

geosoft.gxpy.project.get_user_input(title='Input required...', prompt='?', kind='string', default='', items='', filemask='')

Display a dialog prompt on the Geosoft Desktop and wait for user input. This method depends on user_input.gx and can only be used from an extension running inside a Geosoft Desktop application.

Parameters:
  • title – dialog box title. A description can be added as a second-line using a line-break. example: “Your title/nDescriptive help”
  • prompt – prompt string to
  • kind – kind of response required: ‘string’, ‘int’, ‘float’, ‘file’, ‘colour’ or ‘list’
  • items – comma-separated string or list/tupple of items for a list
  • default – default value. For multifile can be a string (‘|’ delimiter) or list/tupple.
  • filemask – File type mask ‘.dat’, ‘.dat,.grd’, ‘**,*.grd’ for multiple files Comma delimited, or a list/tupple
Returns:

user response

Raise:

:py:ex:GXCancel if the user cancels the dialog

New in version 9.1.

geosoft.gxpy.project.pause(title='Pause...', cancel=False)

Display a pause dialog, wait for user to press continue or cancel

Parameters:
  • title – The pause dialog title, default is “Pause...”
  • cancel – If True, show a cancel button
Raises:

:py:ex:GXCancel if the user cancels the dialog

New in version 9.2.

geosoft.gxpy.project.running_script()
Returns:1 if running from a script, 0 if running interactively.

New in version 9.1.

geosoft.gxpy.project.user_message(title, message)

Display a message to the user

Parameters:
  • title – message box title
  • message – message

New in version 9.2.