GXSYS class

class geosoft.gx.GXSYS
The SYS library functions perform a wide range functions,
including the storage and retrieval of named parameters
from the current workspace; writing messages to the user;
display of progress bars; retrieving file, date and time
information from the operating system; and providing warning
and error handling functions.

Note:

PARAMETER CONTROL FUNCTIONS

Parameters can be named with an index extension.
For example, a parameter could be named as "PARM[1]".
The index can be a positive number, or it can be a '*'.

If the index is a '*' in "geosoft.gx.GXSYS.set_string()", then the value string
will be parsed into multiple values. Commas are assumed to be delimiters.

E.g.

geosoft.gx.GXSYS.set_string()("group1",
              "multiparm[*]",
              "value1,"value,2","value 3",  value4  ,"value 5 "");

This call will set   multiparm[0] ="value1"
                     multiparm[1] ="value,2"
                     multiparm[2] ="value 3"
                     multiparm[3] ="value4"
                     multiparm[4] ="value 5"

To read a parameter, name the parameter with the index.  Thre is no
looped-reading ability.  For example:

     GetString_SYS("group1","multiparm[3]",sSetting);

     returns sSetting = "value4"
static absolute_file_name((GXContext)ctx, (str)arg1, (str_ref)arg2) → None:
Convert an abbreviated path name to a full path name.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This is mainly intended to convert ".name" to a full
name at run-time.
static add_lineage_parameter((GXContext)ctx, (str)arg1, (str)arg2) → None:
Add a parameter to the current lineage object
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Paramter Name
  • arg2 (str) – Parameter Value
Returns:

Nothing

Return type:

None

New in version 7.0.0.

static add_lineage_source((GXContext)ctx, (int)arg1, (str)arg2) → None:
Add a source to the current lineage object
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

static backup_geo_file((GXContext)ctx, (str)arg1, (str_ref)arg2) → None:
Backup a Geosoft data file and all associated files to a temporary folder.
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

Note:

Grids are copied and the GI's are maintained - note that support
for non-geosoft grids is limited since this method does not
guarantee all grid files besides the main one are copied.
static break_date((GXContext)ctx, (float)arg1, (int_ref)arg2, (int_ref)arg3, (int_ref)arg4) → None:
Breaks a decimal date value into year, month and day.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.1.

static check_arc_license((GXContext)ctx) → int:
Check to see if a ESRI ArcEngine or ArcView license is available
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:1 - Licenced 0 - Not licenced
Return type:int

New in version 7.1.0.

static check_intrinsic((GXContext)ctx, (int)arg1, (str)arg2) → int:
Check to see if an intrinsic object is licensed
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (int) – Intrinsic Class Number
  • arg2 (str) – Intrinsic Name (must be exact)
Returns:

1 - Licenced 0 - Not licenced

Return type:

int

New in version 6.0.0.

static check_stop((GXContext)ctx) → int:
This method is called at convenient points in the
GX code to check if the user has asked the script
to stop running. This method should be called by
any GX program that may take a while to complete.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:0 - No 1 - Yes, Terminate processing.
Return type:int

New in version 5.0.0.

static clear_err_ap((GXContext)ctx) → int:
This method is called at to clear all registered errors.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:0 - Successful
Return type:int

New in version 5.1.1.

static clear_group((GXContext)ctx, (str)arg1) → None:
Clear current contents of a group
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static clear_group_parm((GXContext)ctx, (str)arg1) → None:
Clears all paramters in a specified group.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.1.

static clear_lineage_parameters((GXContext)ctx) → None:
Clear all the lineage parameters
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Nothing
Return type:None

New in version 7.0.0.

static clear_lineage_sources((GXContext)ctx) → None:
Clear all the lineage sources
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Nothing
Return type:None

New in version 7.0.0.

static clear_parm((GXContext)ctx) → None:
Clears all paramters.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Nothing
Return type:None

New in version 5.0.0.

static clipboard_to_file((GXContext)ctx, (str)arg1) → None:
Copy text from the clipboard to a file.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static copy_file((GXContext)ctx, (str)arg1, (str)arg2) → int:
Copy a file.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – source file
  • arg2 (str) – destination file
Returns:

0 if file copied ok. 1 if unable to copy file or source file not found.

Return type:

int

New in version 5.1.8.

static copy_geo_file((GXContext)ctx, (str)arg1, (str)arg2) → None:
Copy a Geosoft data file and all associated files to a new folder
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – File Name
  • arg2 (str) – target directory
Returns:

Nothing

Return type:

None

New in version 7.0.0.

Note:

Grids are copied and the GI's are maintained - note that support
for non-geosoft grids is limited since this method does not
guarantee all grid files besides the main one are copied.
static crc_file((GXContext)ctx, (str)arg1) → int:
Compute the CRC of a file
Parameters:
Returns:

CRC Value

Return type:

int

New in version 6.0.1.

static crc_file_offset((GXContext)ctx, (str)arg1, (int)arg2) → int:
Compute the CRC of a file with an Offset
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – File Name
  • arg2 (int) – Offset in the file (0 for start)
Returns:

CRC Value

Return type:

int

New in version 6.4.0.

static create_clipboard_ra((GXContext)ctx) → GXRA:
Create a RA to read text from the clipboard.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:RA to use for reading.
Return type:geosoft.gx.GXRA

New in version 5.0.0.

Note:

Destroy the RA as soon as possible. As long as it
open the clipboard is not accessible from any
application.
static create_clipboard_wa((GXContext)ctx) → GXWA:
Create a WA to write text on the clipboard.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:WA to use for reading.
Return type:geosoft.gx.GXWA

New in version 5.0.0.

Note:

Destroy the WA as soon as possible. As long as it
open the clipboard is not accessible from any
application.
static date((GXContext)ctx) → float:
Returns the current date in decimal years.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Date in decimal years.
Return type:float

New in version 5.0.0.

Note:

The FormatDate_STR function can be used to convert a date to
a string.
static dateto_long((GXContext)ctx, (float)arg1) → int:
Converts a double date to a value representing total
days elapsed since day 0 of year 0. This uses the
Numerical Receipies Julian function.
Parameters:
Returns:

x - Days

Return type:

int

New in version 6.3.0.

static default_double((GXContext)ctx, (str)arg1, (str)arg2, (float)arg3) → None:
Allows a default real to be set.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
  • arg3 (float) – Real Value to Set
Returns:

Nothing

Return type:

None

New in version 6.0.0.

Note:

The value will only be set if there is no existing
setting.
static default_int((GXContext)ctx, (str)arg1, (str)arg2, (int)arg3) → None:
Allows a default int to be set.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
  • arg3 (int) – Int Value to Set
Returns:

Nothing

Return type:

None

New in version 6.0.0.

Note:

The value will only be set if there is no existing
setting.
static default_string((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3) → None:
Allows a default string to be set.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
  • arg3 (str) – String to Set it To
Returns:

Nothing

Return type:

None

New in version 6.0.0.

Note:

The value will only be set if there is no existing
setting.
static delay((GXContext)ctx, (float)arg1) → int:
Idle delay method.
Parameters:
Returns:

success if the delay has elapsed.

Return type:

int

New in version 6.0.0.

static delete_file((GXContext)ctx, (str)arg1) → int:
Delete a file.
Parameters:
Returns:

0 if file deleted. 1 if unable to find file or delete file.

Return type:

int

New in version 5.0.0.

static delete_gi_file((GXContext)ctx, (str)arg1) → int:
Delete the GI file associated with a grid.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – name of grid file to delete
Returns:

0 if file deleted. 1 if file is not found, or found but could not be deleted.

This is a “one-line” function to take a grid file name, remove the qualifiers, add the ”.gi” and delete the file.

Return type:

int

New in version 5.0.0.

static delete_grid_file((GXContext)ctx, (str)arg1) → int:
Delete a grid file and its associated GI and XML files.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – name of grid file to delete
Returns:

0 if grid file deleted. 1 if grid file not found or if one or more files is found but could not be deleted.

Return type:

int

New in version 7.0.0.

Note:

Deletes the grid file first, and, if they exist, the associated GI
and XML files.
No error is registered if a file is not found or cannot be deleted.
static destroy_ptmp((GXContext)ctx, (int)arg1) → None:
Destroy PTMP.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static dir_exist((GXContext)ctx, (str)arg1) → int:
Check to see if a directory exists
Parameters:
Returns:

0 - Directory doesn’t exist 1 - Directory exists

Return type:

int

New in version 5.0.0.

static disable_gx_debugger((GXContext)ctx) → None:
Disable GX Debugger GUI if active
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Nothing
Return type:None

New in version 5.0.0.

Note:

All breakpoints will be cleared by this call.
static emf_object_size((GXContext)ctx, (str)arg1, (float_ref)arg2, (float_ref)arg3) → None:
Get the size of an EMF object
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.4.0.

static enable_gx_debugger((GXContext)ctx, (str)arg1, (str)arg2) → None:
Enable GX Debugger GUI
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – path that will be scanned recursively for GXC source files
  • arg2 (str) – name of gx where first breakpoint should be set
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Takes as input two strings one a path that will be scanned
recursively for GXC source files and a second string without
a path of the GX where the first breakpoint should be set in (i.e. "gxname.gx").
The source of the GX should be found in the path (e.g. <path>somewheregxname.gxc)
and a breakpoint will be set on the first executing line of this GX. Make sure the
GX binary is newer than the source file, otherwise unexpected results may occur. As
soon as the GX is run the GUI will become visible and it will be possible to set more
breakpoints in any of the GXC files found in the path.
static error((GXContext)ctx, (str)arg1, (str)arg2, (int)arg3) → None:
Register an error message
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – your error file name, “” if none.
  • arg2 (str) – module name in which error occured.
  • arg3 (int) – error number
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Use this function to register your own error
messages when an error occurs in your code.  Your
errors can be provided in your own GER file.  See
GEOSOFT.GER for an example of the GER file format.

If the error # is not found in your error file, the
OE32.GER file, then the GEOSOFT.GER file will be
searched.
static error_tag((GXContext)ctx, (str)arg1, (str)arg2) → None:
Set an error message tag string
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – tag string, ie “%1”.
  • arg2 (str) – string to replace the tag.
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Use this method to replace tag strings in your error
message text with run-time information.  For example,
Geosoft error messages often use the tag strings "%1",
"%2", etc. as place holders to be replaced by a string
which is only known at run-time.
static exist_double((GXContext)ctx, (str)arg1, (str)arg2) → int:
This method checks to see if a real parameter exists.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
Returns:

1 - Yes 0 - No

Return type:

int

New in version 7.2.0.

static exist_env((GXContext)ctx, (str)arg1) → int:
Check if setting exists in environment.
Parameters:
Returns:

1 - Yes 0 - No

Return type:

int

New in version 5.0.0.

static exist_int((GXContext)ctx, (str)arg1, (str)arg2) → int:
This method checks to see if a int parameter exists.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
Returns:

1 - Yes 0 - No

Return type:

int

New in version 7.2.0.

static exist_string((GXContext)ctx, (str)arg1, (str)arg2) → int:
This method checks to see if a string parameter exists.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
Returns:

1 - Yes 0 - No

Return type:

int

New in version 7.2.0.

static file_date((GXContext)ctx, (str)arg1) → float:
File creation date in decimal years.
Parameters:
Returns:

Date in decimal years, rDUMMY if the file does not exist.

Return type:

float

New in version 5.0.0.

Note:

The FormatDate_STR function can be used to convert a date
to a string.
static file_exist((GXContext)ctx, (str)arg1) → int:
Check to see if a file exists
Parameters:
Returns:

0 - File doesn’t exist 1 - File exists

Return type:

int

New in version 5.0.0.

Note:

Use the FULL path for the file name. If the full
path is not specified, then the current working
directory is used for the path.
static file_ren((GXContext)ctx, (str)arg1, (str)arg2) → None:
Rename a file
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Old file name
  • arg2 (str) – New file name
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static file_size((GXContext)ctx, (str)arg1) → int:
Returns size of a file.
Parameters:
Returns:

0 none/error x Size

Return type:

int

New in version 5.0.0.

static file_time((GXContext)ctx, (str)arg1) → float:
File creation time in decimal hours.
Parameters:
Returns:

Date in decimal hours, rDUMMY if the file does not exist.

Return type:

float

New in version 5.0.0.

Note:

The FormatTime_STR function can be used to convert a time
to a string.
static file_to_clipboard((GXContext)ctx, (str)arg1) → None:
Copy a text file onto the clipboard as text.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static file_writable((GXContext)ctx, (str)arg1) → bool:
Check if a file can be created or opened in read-write mode
at a specific location
Parameters:
Returns:

bool

Return type:

bool

New in version 6.2.0.

static find_files_vv((GXContext)ctx, (GXVV)arg1, (str)arg2) → None:
Fill a VV with files matching an input file mask.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Fill a VV with files matching the input file mask.
The VV should be of string type.
static find_path((GXContext)ctx, (str)arg1, (int)arg2, (str_ref)arg3) → int:
Get full path for a file with Geosoft subdirectory parameter.
Parameters:
Returns:

0 if file found. 1 if file not found.

Return type:

int

New in version 6.0.1.

Note:

Directories can be resolved from the Environment section of the
Geosoft registry, or from system environment variables that are
not defined in the Geosoft Environment registry.  The following
file prefixes will be replaced by the environment settings:

<geosoft>      the main Geosoft installation directory
<geosoft2>     the secondary Geosoft installation directory
<geotemp>      the Geosoft temporary file directory
<windows>      the operating system Windows directory
<system>       the operating system system directory
<other>        other environment variables
static find_path_ex((GXContext)ctx, (str)arg1, (int)arg2, (int)arg3, (str_ref)arg4) → int:
Get full path for a file.
Parameters:
Returns:

0 if file found. 1 if file not found.

Return type:

int

New in version 6.0.1.

Note:

Directories can be resolved from the Environment section of the
Geosoft registry, or from system environment variables that are
not defined in the Geosoft Environment registry.  The following
file prefixes will be replaced by the environment settings:

<geosoft>      the main Geosoft installation directory
<geosoft2>     the secondary Geosoft installation directory
<geotemp>      the Geosoft temporary file directory
<windows>      the operating system Windows directory
<system>       the operating system system directory
<other>        other environment variable

Before 6.3. the GEO_DIRECTORY_GXNET would find files in <geosoft>gx.net, this location has been
moved to <geosoft>bin to solve some .Net TypeDescriptor information loading (e.g. for property grids etc.) which would
fail when the assembly containing the types cannot be found in any of the locations expected by the .Net
framework even though the assembly may already be loaded. Any GX.Net assemblies should be added to the new location,
even though the old location will still work for most cases.
static font_lst((GXContext)ctx, (GXLST)arg1, (int)arg2) → None:
List all Windows and geosoft fonts.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

To get TT and GFN fonts, call twice with the same list
and SYS_FONT_TT, then SYS_FONT_GFN, or vice-versa to
change order of listing.
static generate_guid((GXContext)ctx, (str_ref)arg1) → None:
Genrates a GUID string (e.g. {4FEDE8BF-CDAB-430A-8026-1CCC0EC0A2EB})
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.4.0.

static get_directory((GXContext)ctx, (int)arg1, (str_ref)arg2) → None:
Get a directory path
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The path will always end with the file separator character
static get_dot_net_gx_entries((GXContext)ctx, (str)arg1, (str_ref)arg2) → int:
Get the list of entry points that this assembly has
exposed to Oasis montaj.
Parameters:
Returns:

0 success 1 error.

Return type:

int

New in version 6.0.1.

Note:

The list of entry points are passed back as one
string with each entry point seperated by a semi-colon.
For example: NewGDB|Run;NewGDB|RunEx
static get_double((GXContext)ctx, (str)arg1, (str)arg2) → float:
This method returns a real from the parameter block.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
Returns:

Real Value, rDUMMY if parameter not set.

Return type:

float

New in version 6.0.1.

static get_env((GXContext)ctx, (str)arg1, (str_ref)arg2) → None:
Get an environment setting.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static get_error_message_ap((GXContext)ctx, (int)arg1, (str_ref)arg2) → None:
Return the error message text as a string.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (int) – the error index (0 to N-1, where N=number of registered errors)
  • arg2 (geosoft.gx.str_ref) – Buffer to return message in
Returns:

Nothing

Return type:

None

New in version 6.0.0.

Note:

This wrapper is mostly for use outside of GXs,
because in general if an error is registered in a GX
the GX would terminate before it could be called.
Use geosoft.gx.GXSYS.num_errors_ap() to get the number of registered errors.
static get_geodist((GXContext)ctx) → int:
Gets a global flag that indicates whether we are
running within the geodist library
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:0 - Geodist not loaded, 1 - Geodist loaded
Return type:int

New in version 6.3.0.

static get_int((GXContext)ctx, (str)arg1, (str)arg2) → int:
This method returns an int from the parameter block.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
Returns:

Int Value, iDUMMY if the parameter is not set.

Return type:

int

New in version 6.0.1.

static get_license_class((GXContext)ctx, (str_ref)arg1) → None:
Get the current application license class.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.1.0.

Note:

String may be one of :  "ArcGIS"
                        "OasisMontaj"
                        "DapServer"
static get_licensed_user((GXContext)ctx, (str_ref)arg1, (str_ref)arg2) → None:
Get the licensed user name and Company
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.0.

static get_path((GXContext)ctx, (int)arg1, (str_ref)arg2) → None:
Get a Geosoft path
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The path name will have a directory separator at the end.
static get_pattern((GXContext)ctx, (str)arg1, (int_ref)arg2, (float_ref)arg3, (int_ref)arg4, (float_ref)arg5, (int_ref)arg6, (int_ref)arg7) → None:
Gets pattern parameters from the parameter block.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.4.0.

Note:

Gets all the user-definable pattern parameters from
a specified group. Parameters are:
"PAT_NUMBER"    0 is solid fill (default)
"PAT_SIZE"      pattern tile size in mm. (can return iDUMMY)
"PAT_THICKNESS" pattern line thickness in percent of the tile size.
                valid range is 0-100.
"PAT_DENSITY"   Tile spacing. A value of 1 means tiles are laid with no overlap.
                A value of 2 means they overlap each other.
"PAT_COLOR"     The colour value.
"PAT_BACKCOLOR" Background colour value.

Returned values may be DUMMY, but will be acceptable for use with
the geosoft.gx.GXGUI.color_form() function, to set defaults.
static get_ptmp((GXContext)ctx, (int)arg1) → None:
Get temporary saves copy of parameter block.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static get_reg((GXContext)ctx, (GXREG)arg1, (str)arg2) → None:
Get REG parameters.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static get_settings_meta((GXContext)ctx, (GXMETA)arg1) → None:
Get the settings metadata object.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.0.

static get_sys_info((GXContext)ctx, (int)arg1, (str_ref)arg2) → None:
Get system information
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static get_thread_id((GXContext)ctx) → int:
Get the ID the current thread.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:x - ID
Return type:int

New in version 5.1.6.

Note:

In a single threaded application this will always be 0.
static get_timer((GXContext)ctx, (int)arg1, (float_ref)arg2, (float_ref)arg3) → int:
return the elapsed time since the established time.
Parameters:
Returns:

success if the delay has elapsed.

Return type:

int

New in version 6.0.0.

Note:

1st time through call the method with a flag of 1 to identify
the count start time, subsequent times the time will be the time
elapsed since the queried start time.  Do so by settign the flag to 0.
static get_top_error_ap((GXContext)ctx) → int:
Get the error number of the last registered error.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:The top error number registered, 0 if none registered.
Return type:int

New in version 8.0.0.

static get_windows_dir((GXContext)ctx, (str_ref)arg1) → None:
Get the Windows directory path
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static get_workspace_reg((GXContext)ctx, (GXREG)arg1) → None:
Get a copy of the workspace REG;
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The workspace REG is separate from the reg used
to store SYS parameters.

Because geosoft.gx.GXSYS.get_workspace_reg() returns a copy of the
workspace REG, and not the workspace REG itself,
you must call geosoft.gx.GXSYS.set_workspace_reg() if you make changes
to your own REG object and you wish them to take
effect in the workspace REG.
static get_yes_no((GXContext)ctx, (str)arg1, (str)arg2) → int:
Check a YES/NO Setting
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
Returns:

1 - if first char in setting is a “Y” or”y” 0 - Otherwise

Return type:

int

New in version 5.0.0.

static global((GXContext)ctx, (str)arg1, (str_ref)arg2) → int:
Get a global parameter setting.
Parameters:
Returns:

0 if parameter found. 1 if parameter not found or not set.

Return type:

int

New in version 6.0.1.

Note:

The returned string will be empty if the parameter is
not found.

Parameters are derived from GEOSOFT.INI.
This is a standard Windows style INI
file that contains [GROUPS], PARAMETERS and SETTINGS
as follows

[GROUP1]
PARAM1=setting1
PARAM2 setting2
PARAM3 "setting3 is text"

To retrieve an entry, specify the group.parameter.  For
example, iGlobal_SYS("GROUP1.PARAM3",sSetting) will
retrieve the string "setting is text".  The double
quotes will not appear in the setting.
static global_reset((GXContext)ctx, (str)arg1) → None:
Reset the global parameters.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – new INI file name, if “”, use default.
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static global_set((GXContext)ctx, (str)arg1, (str)arg2) → None:
Set a global parameter setting.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Name of the Parameter
  • arg2 (str) – Setting
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static global_write((GXContext)ctx, (str)arg1) → None:
Modify the global parameters.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Global INI file, if “” use default.
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If the global parameters have been changed, use
this function to make the changes permanent,
static gt_string((GXContext)ctx, (str)arg1, (str)arg2, (str_ref)arg3) → None:
This method returns a string in the parameter block.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If the setting exits it is placed in the buffer, otherwise
the buffer will have zero length
static interactive((GXContext)ctx) → int:
Checks to see if you should run interactively.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:0 - Run in batch mode only 1 - Run Interactively only
Return type:int

New in version 5.0.0.

static load_parm((GXContext)ctx, (str)arg1, (str)arg2) → None:
Reads parameters from a file.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Name of the File to read from
  • arg2 (str) – Group Name to write read (“” for all groups)
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static longto_date((GXContext)ctx, (int)arg1) → float:
Converts a value representing total days elapsed since
day 0 of year 0 to a geosoft date. This uses the
Numerical Receipies Julian function.
Parameters:
Returns:

x - Date

Return type:

float

New in version 6.3.0.

static longto_time((GXContext)ctx, (int)arg1) → float:
Converts seconds to decimal hours.
Parameters:
Returns:

x - Time

Return type:

float

New in version 6.3.0.

static make_date((GXContext)ctx, (int)arg1, (int)arg2, (int)arg3) → float:
Returns the decimal date given the year, month and day.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (int) – year
  • arg2 (int) – month (0-11)
  • arg3 (int) – day (0-30)
Returns:

Date in decimal years.

Return type:

float

New in version 5.1.1.

static make_dir((GXContext)ctx, (str)arg1) → int:
Create a directory.
Parameters:
Returns:

0 - Directory made 1 - Directory cannot be made

Return type:

int

New in version 5.0.0.

static make_file_readonly((GXContext)ctx, (str)arg1) → int:
Set a file's read-only attribute.
Parameters:
Returns:

0 if read-only attribute successfully set, 1 if attribute change fails.

Return type:

int

New in version 6.3.0.

static make_file_writable((GXContext)ctx, (str)arg1) → int:
Removes a file's read-only attribute.
Parameters:
Returns:

0 if read-only attribute successfully removed, 1 if attribute change fails.

Return type:

int

New in version 6.3.0.

static num_errors_ap((GXContext)ctx) → int:
Returns the number of registered errors.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:The number of registered errors.
Return type:int

New in version 6.0.0.

Note:

This wrapper is mostly for use outside of GXs,
because in general if an error is registered in a GX
the GX would terminate before it could be called.

See also

GetErrorMessageAP_SYS

static prog_name((GXContext)ctx, (str)arg1, (int)arg2) → None:
This method allows you to name the current process being
displayed by the progress bar. This method has no affect
if no progress bar exists.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – New Process Name
  • arg2 (int) – 0 - Change the Name but do not change the percentage 1 - Change the Name and Reset Percent to 0 2 - Change the Name but no Percent Bar
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static prog_state((GXContext)ctx) → int:
Return current progress state (On/Off)
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Return type:int

New in version 7.2.0.

Note:

This is useful, for instance, when calling one GX from another,
especially if it is called multiple times in a loop.
The called GX may turn the progress ON/OFF on its own, which
means any progress tracking in the calling GX is disrupted.
The called GX should use this function to determine the original
progress state, and not turn off progress if it was already on.

Returns                               0 - Progress is on
- Progress is off
static prog_update((GXContext)ctx, (int)arg1) → None:
This method drives the Progress Bar. It is passed
a percentage and will update the bar to reflect that
percentage.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (int) – Percentage Completed (0-100).
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static prog_update_l((GXContext)ctx, (int)arg1, (int)arg2) → None:
Updates progress bar based on count and maxcount.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (int) – count
  • arg2 (int) – max count >= count
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static progress((GXContext)ctx, (int)arg1) → None:
This method allows you to turn on the Progress BAR ON/OFF.
Once the progress bar is on, use the UpdateProg method
to drive it.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (int) – 0 - Turn Progress Bar OFF 1 - Turn Progress Bar ON
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static registry_delete_key((GXContext)ctx, (int)arg1, (str)arg2) → int:
Delete a registry value
Parameters:
Returns:

0 - Ok 1 - Error

Return type:

int

New in version 5.0.0.

Note:

All sub-keys and values will be deleted if they exist.
static registry_delete_val((GXContext)ctx, (int)arg1, (str)arg2, (str)arg3) → int:
Delete a registry value
Parameters:
Returns:

0 - Ok 1 - Error

Return type:

int

New in version 5.0.0.

static registry_get_val((GXContext)ctx, (int)arg1, (str)arg2, (str)arg3, (str_ref)arg4) → int:
Get a registry value
Parameters:
Returns:

0 if value exists 1 if value does not exist

Return type:

int

New in version 6.0.1.

static registry_set_val((GXContext)ctx, (int)arg1, (str)arg2, (str)arg3, (str)arg4) → None:
Set/create a registry value
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This function will create the subkey and key if either do not
already exist.
static relative_file_name((GXContext)ctx, (str)arg1, (str_ref)arg2) → None:
Convert a file name to a relative abbreviated path name
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.1.

Note:

This will produce relative paths based on the workspace
directory into ".name".
static remove_lineage_output((GXContext)ctx, (str)arg1) → None:
Remove an output from the current lineage object
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.1.

static remove_lineage_parameter((GXContext)ctx, (str)arg1) → None:
Remove a parameter in the current lineage object
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

static remove_lineage_source((GXContext)ctx, (str)arg1) → None:
Remove a source from the current lineage object
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

static replace_string((GXContext)ctx, (str)arg1, (str_ref)arg2, (str)arg3) → None:
Replace "% %" tokens in a string with parameter values
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If parameter does not exist, the token is removed.  Full parameter names,
such as "%group.name%", are used as-is.  Partial parameter names, such as
"%name%" will have the default group attached.
static restore_geo_file((GXContext)ctx, (str)arg1, (str)arg2) → None:
Backup a Geosoft data file and all associated files to original location
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Backup File Name
  • arg2 (str) – Original file name
Returns:

Nothing

Return type:

None

New in version 7.0.0.

Note:

Grids are copied and the GI's are maintained - note that support
for non-geosoft grids is limited since this method does not
guarantee all grid files besides the main one are copied.
static run((GXContext)ctx, (str)arg1, (str)arg2, (int)arg3) → int:
Run a command line process.
Parameters:
Returns:

-1 if failed to execute task Exit status of the task

Return type:

int

New in version 5.0.0.

Note:

The Default option for each define below is the first one
and is set to 0.

We look for the command object in the following order:

    1. the local working directory
    2. the <geosoft>bin directory
    3. the system path
static run_gs((GXContext)ctx, (str)arg1) → int:
Run a GS.
Parameters:
Returns:

Exit status of the GS -1 cancelled 0 success 1 ended with an error.

Return type:

int

New in version 5.0.0.

static run_gx((GXContext)ctx, (str)arg1) → int:
Run a GX.
Parameters:
Returns:

Exit status of the GX: -1 cancelled 0 success 1 ended with an error.

Return type:

int

New in version 5.0.0.

Note:

If the called GX returns an error, they will not be
displayed until the "top" calling GX terminates, unless you
call geosoft.gx.GXSYS.show_error()().
static run_gx_ex((GXContext)ctx, (str)arg1, (int_ref)arg2) → int:
Run a GX.
Parameters:
Returns:

Exit status of the GX: -1 cancelled 0 success 1 ended with an error.

Return type:

int

New in version 5.0.0.

static run_multi_user_script((GXContext)ctx, (str)arg1, (int)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6) → None:
Execute a script using multithreaded users
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Script to run
  • arg2 (int) – Number of users to run
  • arg3 (int) – Number of iterations to run (for each user)
  • arg4 (int) – Minimum wait time between iterations (0 for none)
  • arg5 (int) – Maximum wait time between iterations (0 for none)
  • arg6 (int) – Ramp up time for users (0 for all users start immediatly)
Returns:

Nothing

Return type:

None

New in version 5.1.6.

Note:

No access is provided in the script to EMAPS
or EDBS. Users must ensure that the resources
that are shared are protected.
static save_parm((GXContext)ctx, (str)arg1, (int)arg2, (str)arg3) → None:
Writes out one group (or all groups) to a file.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Name of the File
  • arg2 (int) – 0 - New file, 1 - Append
  • arg3 (str) – Group Name to write out (“” for all groups)
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static save_ptmp((GXContext)ctx, (str)arg1) → int:
Save a temporary copy of the parameter block.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name to save, “” for everything.
Returns:

PTMP handle.

Return type:

int

New in version 5.0.0.

Note:

All PTMP instances will be destroyed on exit.
static script((GXContext)ctx) → int:
Checks to see if we are running inside OMS (script mode)
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:0 - Normal mode 1 - Scripting mode

A number of functions can only be run from inside Oasis montaj (such as GetDisplayAreaRaw_EMAP), because they require an actual window object, such as an editable database or map. Use this function to prevent calls

Return type:int

New in version 6.0.1.

static script_record((GXContext)ctx) → int:
Checks to see if we are in scripting recording mode
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:0 - Normal mode 1 - Recording mode
Return type:int

New in version 6.3.0.

static secondsto_time((GXContext)ctx, (float)arg1) → float:
Converts fractional seconds to decimal hours.
Parameters:
Returns:

x - Time

Return type:

float

New in version 6.3.0.

static send_general_message((GXContext)ctx, (str)arg1, (str)arg2) → None:
Send a general information message to all listners
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Message Class
  • arg2 (str) – Message Info
Returns:

Nothing

Return type:

None

New in version 6.3.0.

static set_double((GXContext)ctx, (str)arg1, (str)arg2, (float)arg3) → None:
This method Sets a real in the parameter block.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
  • arg3 (float) – Real
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static set_env((GXContext)ctx, (str)arg1, (str)arg2) → None:
Set an environment setting.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – setting
  • arg2 (str) – value
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static set_int((GXContext)ctx, (str)arg1, (str)arg2, (int)arg3) → None:
This method sets an int in the parameter block.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
  • arg3 (int) – Int Value to Set
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static set_interactive((GXContext)ctx, (int)arg1) → None:
Sets the interactive mode.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (int) – 0 - interactive off 1 - interative on
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Call to geosoft.gx.GXSYS.interactive() will return the value
set here.
static set_lineage_description((GXContext)ctx, (str)arg1) → None:
Set the description for the current lineage object
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

static set_lineage_display_name((GXContext)ctx, (str)arg1) → None:
Set the display name for the current lineage object
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

static set_lineage_name((GXContext)ctx, (str)arg1) → None:
Set the name for the current lineage object
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

static set_pattern((GXContext)ctx, (str)arg1, (int)arg2, (float)arg3, (int)arg4, (float)arg5, (int)arg6, (int)arg7) → None:
Sets pattern parameters in the parameter block.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (int) – Pattern
  • arg3 (float) – Size. Input GS_R8DM to use default
  • arg4 (int) – Thickness (0-100). Input GS_S4DM to use default
  • arg5 (float) – Density. Input GS_R8DM to use default
  • arg6 (int) – Pattern Color
  • arg7 (int) – Background Color. Can be C_TRANSPARENT
Returns:

Nothing

Return type:

None

New in version 6.4.0.

Note:

Sets all the user-definable pattern parameters to
a specified group. Parameters are:
"PAT_NUMBER"    0 is solid fill
"PAT_SIZE"      pattern tile size in mm.
"PAT_THICKNESS" pattern line thickness in percent of the tile size.
                valid range is 0-100.
"PAT_DENSITY"   Tile spacing. A value of 1 means tiles are laid with no overlap.
                A value of 2 means they overlap each other.
"PAT_COLOR"     The colour value.
"PAT_BACKCOLOR" Background colour value.

Input values may be DUMMY.

Designed for use along with the sPatternForm_GUI function.
static set_reg((GXContext)ctx, (GXREG)arg1) → None:
Copy contents of a REG to current parameters.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static set_return((GXContext)ctx, (int)arg1) → None:
Set the return value of a GX.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This value is returned in the geosoft.gx.GXSYS.run_gx_ex() call only.
static set_server_messages_ap((GXContext)ctx, (int)arg1) → None:
Control the server message handling.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (int) – 1 - Display messages, 0 - messages reported as errors
Returns:

Nothing

Return type:

None

New in version 6.2.0.

Note:

Should be set to false when dialogs should not
appear. This setting is thread specific.
static set_settings_meta((GXContext)ctx, (GXMETA)arg1) → None:
Set the settings metadata object.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.0.

static set_string((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3) → None:
This method sets a string in the parameter block.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Group Name
  • arg2 (str) – Parameter Name
  • arg3 (str) – String to Set it To
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static set_workspace_reg((GXContext)ctx, (GXREG)arg1) → None:
Set the workspace REG;
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The workspace REG is separate from the reg used
to store SYS parameters.

Because geosoft.gx.GXSYS.get_workspace_reg() returns a copy of the
workspace REG, and not the workspace REG itself,
you must call geosoft.gx.GXSYS.set_workspace_reg() if you make changes
to your own REG object and you wish them to take
effect in the workspace REG
static shell_execute((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3, (str)arg4, (int)arg5) → int:
MS ShellExecute function
Parameters:
Returns:

return value of ShellExecute command

See ShellExecute description in MSDN

Return type:

int

New in version 5.0.0.

Note:

Examples

geosoft.gx.GXSYS.shell_execute()(open;http://www.geosoft.com);
geosoft.gx.GXSYS.shell_execute()(open;"mailto:geonet@lists.geosoft.com");
geosoft.gx.GXSYS.shell_execute()(open;"mailto:majordomo@lists.geosoft.com?body=UNSUBSCRIBE%20gxnet");

See also

geosoft.gx.GXSYS.do_command()

static short_path_file_name((GXContext)ctx, (str)arg1, (str_ref)arg2) → None:
Obtains the short path form of a specified input path.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static temp_file_ext((GXContext)ctx, (str)arg1, (str_ref)arg2) → None:
Generate a unique file name for this extension in the temp directory.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

This is useful for created a unique tempory name for a file in the Geosoft temporary directory.
static temp_file_name((GXContext)ctx, (str)arg1, (str_ref)arg2) → None:
Generate a file name for this file in the temp directory.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This is useful for created a unique tempory name for a file in the Geosoft temporary directory.

From version 7.0 The file extension will match the input file, but the
filename itself will be a process and thread unique value to ensure that
clashes does not happen.
static terminate((GXContext)ctx, (str)arg1) → None:
DLL error termination
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Call this function immediately before returning to
the caller after an error has occured inside the
DLL.  If an error has occured, you should clean-up
(free memory, close files), call geosoft.gx.GXSYS.error() to register
your own error messages, call geosoft.gx.GXSYS.error_tag() to set any
error message tags, call geosoft.gx.GXSYS.terminate() and return.

Geosoft functions that detect an error will have
already registered their own errors and called
geosoft.gx.GXSYS.terminate().
static time((GXContext)ctx) → float:
Returns the current time in decimal hours.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Time in decimal hours.
Return type:float

New in version 5.0.0.

Note:

The FormatTime_STR function can be used to convert a time to
a string.
static timeto_long((GXContext)ctx, (float)arg1) → int:
Converts decimal hours to seconds in a day.
Parameters:
Returns:

x - Seconds (integer)

Return type:

int

New in version 6.3.0.

static timeto_seconds((GXContext)ctx, (float)arg1) → float:
Converts decimal hours to seconds in a day fractional
Parameters:
Returns:

x - Number of seconds with fractions

Return type:

float

New in version 6.3.0.

static transfer_path((GXContext)ctx, (str)arg1, (str_ref)arg2) → None:
Transfers file path to new file name.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

The path and volume of from the input string is added to
file name from the output string.
static utc_date((GXContext)ctx) → float:
Returns the current UTC date in decimal years.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Date in decimal years.
Return type:float

New in version 7.0.0.

Note:

The FormatDate_STR function can be used to convert a date to
a string.
static utc_file_date((GXContext)ctx, (str)arg1) → float:
File creation UTC date in decimal years.
Parameters:
Returns:

Date in decimal years, rDUMMY if the file does not exist.

Return type:

float

New in version 7.0.0.

Note:

The FormatDate_STR function can be used to convert a date
to a string.
static utc_file_time((GXContext)ctx, (str)arg1) → float:
File creation UTC time in decimal hours.
Parameters:
Returns:

Date in decimal hours, rDUMMY if the file does not exist.

Return type:

float

New in version 7.0.0.

Note:

The FormatTime_STR function can be used to convert a time
to a string.
static utc_time((GXContext)ctx) → float:
Returns the current UTC time in decimal hours.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Time in decimal hours.
Return type:float

New in version 7.0.0.

Note:

The FormatTime_STR function can be used to convert a time to
a string.
static valid_file_name((GXContext)ctx, (str)arg1) → int:
Check to see if a file name valid
Parameters:
Returns:

0 - File name is not valid 1 - File name is valid

Return type:

int

New in version 5.0.0.

Note:

Use the FULL path for the file name. If the full
path is not specified, then the current working
directory is used for the path.
static write_debug_log((GXContext)ctx, (str)arg1) → None:
This method writes out information to the output
debugging log file (in temp folder) or output window.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.3.0.

static write_in_dir((GXContext)ctx, (str)arg1) → int:
Can I create files in this directory ?
Parameters:
Returns:

0 - Directory doesn’t allow write of does not exist 1 - Directory allows writes

Return type:

int

New in version 5.0.0.

GEO_DIRECTORY constants

Geosoft directory defines
gx.GEO_DIRECTORY_NONE = 0
None
gx.GEO_DIRECTORY_GEOSOFT = 1
Geosoft\
gx.GEO_DIRECTORY_BIN = 2
Geosoft\bin
gx.GEO_DIRECTORY_GER = 3
Geosoft\ger
gx.GEO_DIRECTORY_OMN = 4
Geosoft\omn
gx.GEO_DIRECTORY_TBL = 5
Geosoft\tbl
gx.GEO_DIRECTORY_FONTS = 6
Geosoft\fonts
gx.GEO_DIRECTORY_GX = 7
Geosoft\gx
gx.GEO_DIRECTORY_GS = 8
Geosoft\gs
gx.GEO_DIRECTORY_APPS = 9
Geosoft\apps
gx.GEO_DIRECTORY_ETC = 10
Geosoft\user\etc and then Geosoft\etc
gx.GEO_DIRECTORY_HLP = 11
Geosoft\hlp
gx.GEO_DIRECTORY_USER_CSV = 14
Geosoft\user\csv
gx.GEO_DIRECTORY_USER_LIC = 15
Geosoft\user\lic
gx.GEO_DIRECTORY_USER_INI = 16
Geosoft\user\ini
gx.GEO_DIRECTORY_USER_TEMP = 17
Geosoft\temp (or where the user put it)
gx.GEO_DIRECTORY_USER_ETC = 18
Geosoft\user\etc
gx.GEO_DIRECTORY_IMG = 19
Geosoft\img
gx.GEO_DIRECTORY_BAR = 20
Geosoft\bar
gx.GEO_DIRECTORY_GXNET = 21
Geosoft\bin (if not found will also try Geosoft\gx.net for legacy location, see notes in iFindPathEx for more information)
gx.GEO_DIRECTORY_MAPTEMPLATE = 22
Geosoft\maptemplate
gx.GEO_DIRECTORY_USER_MAPTEMPLATE = 23
Geosoft\user\maptemplate

REG_DOMAIN constants

Registry key domains
gx.REG_DOMAIN_MACHINE = 0
same as HKEY_LOCAL_MACHINE in Windows
gx.REG_DOMAIN_USER = 1
same as HKEY_CURRENT_USER in Windows

SHELL_EXECUTE constants

Shell execute defines
gx.SW_HIDE = 0
gx.SW_SHOWNORMAL = 1
gx.SW_SHOWMINIMIZED = 2
gx.SW_SHOWMAXIMIZED = 3
gx.SW_SHOWNOACTIVATE = 4
gx.SW_SHOW = 5
gx.SW_MINIMIZE = 6
gx.SW_SHOWMINNOACTIVE = 7
gx.SW_SHOWNA = 8
gx.SW_RESTORE = 9
gx.SW_SHOWDEFAULT = 10
gx.SW_FORCEMINIMIZE = 11

SYS_DIR constants

SYS Directory locations
gx.SYS_DIR_LOCAL = 0
is the workspace working directory
gx.SYS_DIR_GEOSOFT = 1
is the geosoft installation directory (read-only)
gx.SYS_DIR_USER = 2
is the geosoft installation directory that
contains user read/write files.
gx.SYS_DIR_GEOTEMP = 3
Geosoft Temp folder
gx.SYS_DIR_WINDOWS = 4
Windows folder
gx.SYS_DIR_SYSTEM = 5
Windows SYSTEM folder
gx.SYS_DIR_LICENSE = 6
Where the license file is stored
gx.SYS_DIR_RESOURCEFILES = 7
User RESOURCEFILES Folder
gx.SYS_DIR_GEOSOFT_BAR = 100
BAR folder
gx.SYS_DIR_GEOSOFT_BIN = 101
BIN folder
gx.SYS_DIR_GEOSOFT_CSV = 102
CSV folder
gx.SYS_DIR_GEOSOFT_CSV_ALIASES = 103
CSV ALIASES folder
gx.SYS_DIR_GEOSOFT_DATA = 104
DATA folder
gx.SYS_DIR_GEOSOFT_DBG = 105
DBG folder
gx.SYS_DIR_GEOSOFT_ENCRYPTEDFILES = 106
Encrypted Files folder
gx.SYS_DIR_GEOSOFT_ETC = 107
ETC folder
gx.SYS_DIR_GEOSOFT_FONTS = 108
FONTS folder
gx.SYS_DIR_GEOSOFT_GER = 109
GER folder
gx.SYS_DIR_GEOSOFT_GS = 110
GS folder
gx.SYS_DIR_GEOSOFT_GX = 111
GX folder
gx.SYS_DIR_GEOSOFT_HLP = 112
HLP folder
gx.SYS_DIR_GEOSOFT_IMG = 113
IMG folder
gx.SYS_DIR_GEOSOFT_INI = 114
INI folder
gx.SYS_DIR_GEOSOFT_MAPTEMPLATE = 115
MAPTEMPLATE folder
gx.SYS_DIR_GEOSOFT_OMN = 116
OMN folder
gx.SYS_DIR_GEOSOFT_PAGE = 117
PAGE folder
gx.SYS_DIR_GEOSOFT_SCHEMA = 118
SCHEMA folder
gx.SYS_DIR_GEOSOFT_SPEC_INI = 119
SPEC INI older
gx.SYS_DIR_GEOSOFT_STYLESHEETS = 120
STYLE SHEETS folder
gx.SYS_DIR_GEOSOFT_TBL = 121
TBL folder
gx.SYS_DIR_USER_CSV = 200
User CSV Folder
gx.SYS_DIR_USER_ETC = 201
User ETC Folder
gx.SYS_DIR_USER_GS = 202
User GS Folder
gx.SYS_DIR_USER_HLP = 203
User HLP Folder
gx.SYS_DIR_USER_INI = 204
User INI Folder
gx.SYS_DIR_USER_LIC = 205
User LIC Folder
gx.SYS_DIR_USER_MAPTEMPLATE = 206
User MAPTEMPLATE Folder
gx.SYS_DIR_USER_OMN = 207
User OMN Folder
gx.SYS_DIR_USER_STACKS = 209
User STACKS Folder
gx.SYS_DIR_USER_TEMP = 210
User TEMP Folder
gx.SYS_DIR_USER_SERVICES = 211
User SERVICES Folder
gx.SYS_DIR_USER_STYLESHEETS = 212
User STYLESHEETS Folder

SYS_FONT constants

Font types
gx.SYS_FONT_GFN = 1
Geosoft GFN fonts.
gx.SYS_FONT_TT = 0
available TrueType fonts

SYS_INFO constants

System information
gx.SYS_INFO_VERSION_MAJOR = 0
gx.SYS_INFO_VERSION_MINOR = 1
gx.SYS_INFO_VERSION_SP = 2
gx.SYS_INFO_BUILD_NUMBER = 3
gx.SYS_INFO_BUILD_LABEL = 4
gx.SYS_INFO_VERSION_LABEL = 5
gx.SYS_INFO_PRODUCTNAME = 6
gx.SYS_INFO_SERVERNAME = 7
gx.SYS_INFO_LEGALCOPYRIGHT = 8
gx.SYS_INFO_REGISTRY = 9
gx.SYS_INFO_REGISTRY_ENVIRONMENT = 10
gx.SYS_INFO_REGISTRY_SUPPORT = 11
gx.SYS_INFO_REGISTRY_INTERAPP = 12
gx.SYS_INFO_OIS_REGISTRY = 13
gx.SYS_INFO_TEST_REGISTRY = 14

SYS_LINEAGE_SOURCE constants

Type of lineage sources
gx.SYS_LINEAGE_SOURCE_MAP = 0
gx.SYS_LINEAGE_SOURCE_MXD = 1
gx.SYS_LINEAGE_SOURCE_DB = 2
gx.SYS_LINEAGE_SOURCE_MAPTEMPLATE = 3
gx.SYS_LINEAGE_SOURCE_GRID = 4
gx.SYS_LINEAGE_SOURCE_VOXEL = 5

SYS_MENU_CLEAR constants

Font types
gx.SYS_MENU_CLEAR_ALL = 0
Clear all menus excluding the coremenus.omn
but including any default menus specified in the settings (these will not come back in this project).
gx.SYS_MENU_CLEAR_DEFAULT = 1
Clear all menus excluding the coremenus.omn
but reload any default menus specified in the settings (essentially this is a refresh
back to the default state again).

SYS_PATH constants

Get specific Geosoft paths. The path name will
have a directory separator at the end.
gx.SYS_PATH_LOCAL = 0
is the workspace working directory
gx.SYS_PATH_GEOSOFT = 1
is the geosoft installation directory (read-only)
gx.SYS_PATH_GEOSOFT_USER = 2
is the geosoft installation directory that
contains user read/write files.
gx.SYS_PATH_GEOTEMP = 3
Geosoft Temp folder
gx.SYS_PATH_WINDOWS = 4
Windows folder
gx.SYS_PATH_SYSTEM = 5
System folder
gx.SYS_PATH_LICENSE = 6
Where the license file is stored
gx.SYS_PATH_RESOURCEFILES = 7
User RESOURCEFILES Folder
gx.SYS_PATH_GEOSOFT_BAR = 100
BAR folder
gx.SYS_PATH_GEOSOFT_BIN = 101
BIN folder
gx.SYS_PATH_GEOSOFT_CSV = 102
CSV folder
gx.SYS_PATH_GEOSOFT_CSV_ALIASES = 103
CSV ALIASES folder
gx.SYS_PATH_GEOSOFT_DATA = 104
DATA folder
gx.SYS_PATH_GEOSOFT_DBG = 105
DBG folder
gx.SYS_PATH_GEOSOFT_ENCRYPTEDFILES = 106
Encrypted Files folder
gx.SYS_PATH_GEOSOFT_ETC = 107
ETC folder
gx.SYS_PATH_GEOSOFT_FONTS = 108
FONTS folder
gx.SYS_PATH_GEOSOFT_GER = 109
GER folder
gx.SYS_PATH_GEOSOFT_GS = 110
GS folder
gx.SYS_PATH_GEOSOFT_GX = 111
GX folder
gx.SYS_PATH_GEOSOFT_HLP = 112
HLP folder
gx.SYS_PATH_GEOSOFT_IMG = 113
IMG folder
gx.SYS_PATH_GEOSOFT_INI = 114
INI folder
gx.SYS_PATH_GEOSOFT_MAPTEMPLATE = 115
MAPTEMPLATE folder
gx.SYS_PATH_GEOSOFT_OMN = 116
OMN folder
gx.SYS_PATH_GEOSOFT_PAGE = 117
PAGE folder
gx.SYS_PATH_GEOSOFT_SCHEMA = 118
SCHEMA folder
gx.SYS_PATH_GEOSOFT_SPEC_INI = 119
SPEC INI older
gx.SYS_PATH_GEOSOFT_STYLESHEETS = 120
STYLE SHEETS folder
gx.SYS_PATH_GEOSOFT_TBL = 121
TBL folder
gx.SYS_PATH_GEOSOFT_USER_CSV = 200
User CSV Folder
gx.SYS_PATH_GEOSOFT_USER_ETC = 201
User ETC Folder
gx.SYS_PATH_GEOSOFT_USER_GS = 202
User GS Folder
gx.SYS_PATH_GEOSOFT_USER_HLP = 203
User HLP Folder
gx.SYS_PATH_GEOSOFT_USER_INI = 204
User INI Folder
gx.SYS_PATH_GEOSOFT_USER_LIC = 205
User LIC Folder
gx.SYS_PATH_GEOSOFT_USER_MAPTEMPLATE = 206
User MAPTEMPLATE Folder
gx.SYS_PATH_GEOSOFT_USER_OMN = 207
User OMN Folder
gx.SYS_PATH_GEOSOFT_USER_STACKS = 209
User STACKS Folder
gx.SYS_PATH_GEOSOFT_USER_TEMP = 210
User TEMP Folder
gx.SYS_PATH_USER_SERVICES = 211
User SERVICES Folder
gx.SYS_PATH_USER_STYLESHEETS = 212
User STYLESHEETS Folder

SYS_RUN_DISPLAY constants

Windows Display Options
Determine how applications are started.
These options are not yet implemented.
gx.SYS_RUN_DISPLAY_WINDOW = 0
In a window  (default)
gx.SYS_RUN_DISPLAY_MINIMIZE = 8
Maximized
gx.SYS_RUN_DISPLAY_FULLSCREEN = 16
Full Screen

SYS_RUN_HOLD constants

DOS Console Options
These options determine if and when the DOS/EXE
console window is held. These options only work
on DOS and EXE programs.
gx.SYS_RUN_HOLD_NEVER = 0
Don't wait (Default)
gx.SYS_RUN_HOLD_ONERROR = 512
Hold the screen if there is an error
gx.SYS_RUN_HOLD_ALWAYS = 1024
Always hold the screen

SYS_RUN_TYPE constants

Type of application to run
gx.SYS_RUN_TYPE_DOS = 1
Things such as .BAT files, copy commands, etc. (A console window is created)
gx.SYS_RUN_TYPE_EXE = 0
Any program (.EXE) (a console window is created)
gx.SYS_RUN_TYPE_WINDOWS = 2
Windows applications that do not require a console window.

SYS_RUN_WIN constants

Windows Options
Should we wait for the application to
finish or should we continue executing. If you wait
for another program, Oasis montaj will not
redraw or respond. We always wait for EXE and DOS programs.
gx.SYS_RUN_WIN_NOWAIT = 0
Never wait (default)
gx.SYS_RUN_WIN_WAIT = 2048
Always wait

SYS_SEARCH_PATH constants

Find File define
gx.FIND_LOCAL_GEOSOFT = 0
Local and then Geosoft directory
gx.FIND_GEOSOFT = 1
Geosoft directory
gx.FIND_LOCAL = 2
Local directory
gx.FIND_SHORT = 1024
Make the name short (FLAG that is added on)