GXSYS classΒΆ
- class GXSYS(handle=0)[source]ΒΆ
GXSYS class.
The
GXSYS
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
set_string
, then the value string will be parsed into multiple values. Commas are assumed to be delimiters.E.g.
"group1", "multiparm[*]", "value1,\"value,2\",\"value 3\", value4 ,\"value 5 \""
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. There is no looped-reading ability. For example using the following with
gt_string
:"group1","multiparm[3]",setting
will return:
setting = "value4"
- classmethod abort(message)[source]ΒΆ
This method terminates the execution of a script. A message giving the reason for the abort will be displayed along with the line number where we stopped in the script.
- Parameters:
message (str) β Message to display
New in version 5.0.
License: Geosoft Open License
- classmethod absolute_file_name(abbr, name)[source]ΒΆ
Convert an abbreviated path name to a full path name.
- Parameters:
abbr (str) β Input file name to resolve
name (str_ref) β Output name, can be the same as input
New in version 5.0.
License: Geosoft Open License
Note: This is mainly intended to convert β.nameβ to a full name at run-time.
- classmethod add_lineage_parameter(name, value)[source]ΒΆ
Add a parameter to the current lineage object
- Parameters:
name (str) β Paramter Name
value (str) β Parameter Value
New in version 7.0.
License: Geosoft Open License
- classmethod add_lineage_source(source_type, source_name)[source]ΒΆ
Add a source to the current lineage object
- Parameters:
source_type (int) β SYS_LINEAGE_SOURCE constants
source_name (str) β Source Name
New in version 7.0.
License: Geosoft Open License
- classmethod assert_(exp)[source]ΒΆ
Abort with GX line number if not true.
- Parameters:
exp (int) β Expression to evaluate (0 aborts)
New in version 5.0.
License: Geosoft Open License
- classmethod assert_gx(exp, mod, parm)[source]ΒΆ
DLL function argument error assertion
- Parameters:
exp (int) β Boolean expression (ie. (dB != 0.0) )
mod (str) β Module name
parm (str) β Argument name
- Returns:
0 assertion passed 1 assertion failed
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: Use this function to evaluate errors in passed function arguments. Functions called by GX programs should be tolerant of all errors in the passed argument list. The
assert_gx
can be used to test each argument before doing any work in the function. If an assertion fails, an error will be registered with the name of the function and the parameter name and a 1 will be returned. The caller should immediatley cleaning up (if necessary) and return.You could also test the validity of arguments and call the
error
,error_tag
andterminate
functions if you would like to provide a more specific error message.
- classmethod backup_geo_file(data, target)[source]ΒΆ
Backup a Geosoft data file and all associated files to a temporary folder.
- Parameters:
data (str) β File Name
target (str_ref) β Buffer to place the target name into
New in version 7.0.
License: Geosoft End-User License
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.
- classmethod break_date(date, year, month, day)[source]ΒΆ
Breaks a decimal date value into year, month and day.
- Parameters:
New in version 5.1.1.
License: Geosoft Open License
- classmethod cancel_()[source]ΒΆ
This method indicates that the GX program terminated without doing anything of interest and should be ignored. In particular, the GX will not be logged in a recorded GS.
New in version 5.0.
License: Geosoft Open License
- classmethod check_arc_license()[source]ΒΆ
Check to see if a ESRI ArcEngine or ArcView license is available
- Returns:
1 - Licenced 0 - Not licenced
- Return type:
int
New in version 7.1.
License: Geosoft Open License
- classmethod check_arc_license_ex(version)[source]ΒΆ
Check to see if a ESRI ArcEngine or ArcView license is available, returns type and version of available engine.
- Parameters:
version (str_ref) β Version String
- Returns:
- Return type:
int
New in version 9.0.
License: Geosoft Open License
- classmethod check_arc_sdk_license_ex(version)[source]ΒΆ
Check to see if a ESRI ArcGIS Pro SDK and Map SDK license is available, returns type and version of available engine.
- Parameters:
version (str_ref) β Version String
- Returns:
ARC_SDK_LICENSE
- Return type:
int
New in version 2024.1.
License: Geosoft Open License
- classmethod check_intrinsic(cl, name)[source]ΒΆ
Check to see if an intrinsic object is licensed
- Parameters:
cl (int) β Intrinsic Class Number
name (str) β Intrinsic Name (must be exact)
- Returns:
1 - Licenced 0 - Not licenced
- Return type:
int
New in version 6.0.
License: Geosoft Open License
- classmethod check_product_updates(silent)[source]ΒΆ
Check for product updates via Geosoft Connect
- Parameters:
silent (bool) β Do not show notification if no updates available.
New in version 9.6.
License: Geosoft Open License
- classmethod check_stop()[source]ΒΆ
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.
- Returns:
0 - No 1 - Yes, Terminate processing.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod clear_err_ap()[source]ΒΆ
This method is called at to clear all registered errors.
- Returns:
0 - Successful
- Return type:
int
New in version 5.1.1.
License: Geosoft Open License
- classmethod clear_group(group)[source]ΒΆ
Clear current contents of a group
- Parameters:
group (str) β Group to clear
New in version 5.0.
License: Geosoft Open License
- classmethod clear_group_parm(group)[source]ΒΆ
Clears all paramters in a specified group.
- Parameters:
group (str) β String
New in version 5.1.1.
License: Geosoft Open License
- classmethod clear_lineage_parameters()[source]ΒΆ
Clear all the lineage parameters
New in version 7.0.
License: Geosoft Open License
- classmethod clear_lineage_sources()[source]ΒΆ
Clear all the lineage sources
New in version 7.0.
License: Geosoft Open License
Clear all menus
- Parameters:
flag (int) β SYS_MENU_CLEAR constants
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod clear_parm()[source]ΒΆ
Clears all paramters.
New in version 5.0.
License: Geosoft Open License
- classmethod clipboard_to_file(file)[source]ΒΆ
Copy text from the clipboard to a file.
- Parameters:
file (str) β File name to place it into
New in version 5.0.
License: Geosoft Open License
- classmethod connect_with_current_central_instance(name, base_path, url, token)[source]ΒΆ
Query information necessary to communicate with current Central Instance
- Parameters:
New in version 9.8.
License: Geosoft Open License
- classmethod copy_file(src_file, dest_file)[source]ΒΆ
Copy a file.
- Parameters:
src_file (str) β Source file
dest_file (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.
License: Geosoft Open License
- classmethod copy_geo_file(data, dir)[source]ΒΆ
Copy a Geosoft data file and all associated files to a new folder
- Parameters:
data (str) β File Name
dir (str) β Target directory
New in version 7.0.
License: Geosoft End-User License
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.
- classmethod crc_file(file)[source]ΒΆ
Compute the CRC of a file
- Parameters:
file (str) β File Name
- Returns:
CRC Value
- Return type:
int
New in version 6.0.1.
License: Geosoft Open License
- classmethod crc_file_offset(file, offset)[source]ΒΆ
Compute the CRC of a file with an Offset
- Parameters:
file (str) β File Name
offset (int) β Offset in the file (0 for start)
- Returns:
CRC Value
- Return type:
int
New in version 6.4.
License: Geosoft Open License
- classmethod create_clipboard_ra()[source]ΒΆ
Create a
GXRA
to read text from the clipboard.New in version 5.0.
License: Geosoft Open License
Note: Destroy the
GXRA
as soon as possible. As long as it open the clipboard is not accessible from any application.
- classmethod create_clipboard_wa()[source]ΒΆ
Create a
GXWA
to write text on the clipboard.New in version 5.0.
License: Geosoft Open License
Note: Destroy the
GXWA
as soon as possible. As long as it open the clipboard is not accessible from any application.
- classmethod dat_list_lst(DAT_Type, FileOpenMode, FileType)[source]ΒΆ
Returns a LST of Grid/Image types as names and qualifiers as values`GXLST <geosoft.gxapi.GXLST>` Example: NAME: βGeosoft default (*.grd)β VALUE: βGRDβ
- Parameters:
DAT_Type (str) β DAT type - currently only βXGDβ
FileOpenMode (int) β SYS_FILE_FORM constants
FileType (int) β SYS_DAT_FILE constants sum for both
- Return type:
New in version 2024.1.
License: Geosoft Open License
- classmethod date()[source]ΒΆ
Returns the current date in decimal years.
- Returns:
Date in decimal years.
- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: The FormatDate_STR function can be used to convert a date to a string.
- classmethod dateto_long(date)[source]ΒΆ
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:
date (float) β Date
- Returns:
x - Days
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- classmethod decrypt_string(input, output, key)[source]ΒΆ
Decrypts a string that has been previously encrypted by
encrypt_string
.- Parameters:
input (str) β Input string for decryption.
output (str_ref) β Output buffer for decrypted result.
key (int) β SYS_ENCRYPTION_KEY constants
New in version 9.0.
License: Geosoft Open License
- classmethod default_double(group, field, val)[source]ΒΆ
Allows a default real to be set.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
val (float) β Real Value to Set
New in version 6.0.
License: Geosoft Open License
Note: The value will only be set if there is no existing setting.
- classmethod default_int(group, field, val)[source]ΒΆ
Allows a default int to be set.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
val (int) β Int Value to Set
New in version 6.0.
License: Geosoft Open License
Note: The value will only be set if there is no existing setting.
- classmethod default_string(group, field, val)[source]ΒΆ
Allows a default string to be set.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
val (str) β String to Set it To
New in version 6.0.
License: Geosoft Open License
Note: The value will only be set if there is no existing setting.
- classmethod delay(secs)[source]ΒΆ
Idle delay method.
- Parameters:
secs (float) β Decimal Seconds to delay
- Returns:
Success if the delay has elapsed.
- Return type:
int
New in version 6.0.
License: Geosoft Open License
- classmethod delete_directory(directory)[source]ΒΆ
Delete a directory and all files/subdirectories contained therein.
- Parameters:
directory (str) β Name of directory to delete
New in version 2023.2.
License: Geosoft Open License
- classmethod delete_file(file)[source]ΒΆ
Delete a file.
- Parameters:
file (str) β Name of file to delete
- Returns:
0 if file deleted. 1 if unable to find file or delete file.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod delete_gi_file(file)[source]ΒΆ
Delete the GI file associated with a grid.
- Parameters:
file (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.
License: Geosoft Open License
- classmethod delete_grid_file(file)[source]ΒΆ
Delete a grid file and its associated GI and XML files.
- Parameters:
file (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.
License: Geosoft Open License
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.
- classmethod destroy_ptmp(ptmp)[source]ΒΆ
Destroy PTMP.
- Parameters:
ptmp (int) β PTMP object to destroy
New in version 5.0.
License: Geosoft Open License
- classmethod dir_exist(dir)[source]ΒΆ
Check to see if a directory exists
- Parameters:
dir (str) β Name of directory to check
- Returns:
0 - Directory doesnβt exist 1 - Directory exists
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod disable_gx_debugger()[source]ΒΆ
Disable GX Debugger
GXGUI
if activeNew in version 5.0.
License: Geosoft Open License
Note: All breakpoints will be cleared by this call.
- classmethod display_double(title, real)[source]ΒΆ
Display a real number.
- Parameters:
title (str) β Title of the Window
real (float) β Number
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod display_help(group, topic)[source]ΒΆ
Display the help dialog with the specified topic highlighted
- Parameters:
group (str) β Group string to lookup in gxhelp.ini
topic (str) β Index string to lookup in gxhelp.ini
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod display_help_topic(file, topic)[source]ΒΆ
Display the help dialog without topic lookup in INI files
- Parameters:
file (str) β Help File (blank for default)
topic (str) β Help Topic
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod display_int(title, n)[source]ΒΆ
Display an integer.
- Parameters:
title (str) β Title of the Window
n (int) β Number
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod display_message(title, message)[source]ΒΆ
Display a user message.
- Parameters:
title (str) β Title of the Window
message (str) β Message String
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod display_question(title, message)[source]ΒΆ
Display a YES/NO type question. This method waits for the user to hit YES or NO.
- Parameters:
title (str) β Title of the window
message (str) β Message String
- Returns:
0 - user selected No 1 - user selected YES
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod display_question_with_cancel(title, message)[source]ΒΆ
Display a YES/NO/CANCEL type question. This method waits for the user to hit YES or NO or CANCEL.
- Parameters:
title (str) β Title of the window
message (str) β Message String
- Returns:
0 - user selected No 1 - user selected YES 2 - user selected CANCEL
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod display_task_dialog_ui(title, main_instruction, content, common_buttons, custom_button_lst, icon, footer, footer_icon, verification_check_text, verification_checked, expanded_information, collapsed_control_text, expanded_control_text)[source]ΒΆ
Show a Windows TaskDialog UI (see https://msdn.microsoft.com/en-us/library/windows/desktop/bb760441(v=vs.85).aspx).
- Parameters:
title (str) β Title
main_instruction (str) β Main instruction (empty string for none)
content (str) β Content (empty string for none)
common_buttons (int) β Common Buttons, one of TD_BUTTON constants
custom_button_lst (GXLST) β Optional
GXLST
of custom buttons. Name inGXLST
will be used for button text, while value should be an int to return. Pass (GXLST
)0 to only use standard button flags.icon (int) β Icon TD_ICON constants
footer (str) β Footer (empty string for none)
footer_icon (int) β Footer Icon TD_ICON constants
verification_check_text (str) β Verification checkbox text (empty string for none)
verification_checked (int_ref) β Verification checkbox checked (in/out)
expanded_information (str) β Expanded information (empty string for none)
collapsed_control_text (str) β Collapsed control text for expanded information (empty string for default; βMoreβ)
expanded_control_text (str) β Expanded control text for expanded information (empty string for default; βLessβ)
- Returns:
Button ID. One of TD_ID constants or the int value from
GXLST
of custom buttons.- Return type:
int
New in version 9.3.
License: Geosoft Open License
- classmethod do_command(command)[source]ΒΆ
Execute an Oasis montaj command.
- Parameters:
command (str) β Command
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Commands syntax: β[type] commandβ
type
command
ID
Internal Menu Command (as found in omn and geobar files e.g.
*ID_EDIT_SELECT
)GX
gx file name
GS
gs file name
DOTNET
dll file name Use qualifiers to specify class and method e.g.:
"[DOTNET] geogxnet.dll(Geosoft.GX.NewGDB.NewGDB;Run)"
PDF
Geosoft pdf file name (Not Adobe PDF document, a legacy Geosoft Sushi script)
DOS
DOS style command
HLP
help file name
The must be ONE space between the β]β and the command. For example:
"[ID] ID_EDIT_SELECT"
// bring up the line edit toolSee also
- classmethod emf_object_size(file, size_x, size_y)[source]ΒΆ
Get the size of an EMF object
- Parameters:
New in version 6.4.
License: Geosoft Open License
- classmethod enable_gx_debugger(src_dir, first_gx)[source]ΒΆ
Enable GX Debugger
GXGUI
- Parameters:
src_dir (str) β Path that will be scanned recursively for GXC source files
first_gx (str) β Name of gx where first breakpoint should be set
New in version 5.0.
License: Geosoft Open License
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
GXGUI
will become visible and it will be possible to set more breakpoints in any of the GXC files found in the path.
- classmethod encrypt_string(input, output, key)[source]ΒΆ
Encrypts a string for secure storage in configuration files or in the workspace parameters.
- Parameters:
input (str) β Input string for encryption.
output (str_ref) β Output buffer for encrypted result.
key (int) β SYS_ENCRYPTION_KEY constants
New in version 9.0.
License: Geosoft Open License
- classmethod error(error_file, module, error)[source]ΒΆ
Register an error message
- Parameters:
error_file (str) β Your error file name, ββ if none.
module (str) β Module name in which error occurred.
error (int) β Error number
New in version 5.0.
License: Geosoft Open License
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
GXGER
file. See GEOSOFT.`GXGER <geosoft.gxapi.GXGER>` for an example of theGXGER
file format.If the error # is not found in your error file, the OE32.`GXGER <geosoft.gxapi.GXGER>` file, then the GEOSOFT.`GXGER <geosoft.gxapi.GXGER>` file will be searched.
- classmethod error_tag(tag, set)[source]ΒΆ
Set an error message tag string
- Parameters:
tag (str) β Tag string, ie β%1β.
set (str) β String to replace the tag.
New in version 5.0.
License: Geosoft Open License
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.
- classmethod exist_double(group, field)[source]ΒΆ
This method checks to see if a real parameter exists.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
- Returns:
1 - Yes 0 - No
- Return type:
int
New in version 7.2.
License: Geosoft Open License
- classmethod exist_env(parm)[source]ΒΆ
Check if setting exists in environment.
- Parameters:
parm (str) β Setting
- Returns:
1 - Yes 0 - No
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod exist_int(group, field)[source]ΒΆ
This method checks to see if a int parameter exists.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
- Returns:
1 - Yes 0 - No
- Return type:
int
New in version 7.2.
License: Geosoft Open License
- classmethod exist_string(group, field)[source]ΒΆ
This method checks to see if a string parameter exists.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
- Returns:
1 - Yes 0 - No
- Return type:
int
New in version 7.2.
License: Geosoft Open License
- classmethod exit_()[source]ΒΆ
This method terminates the execution of a script in a regular fashion with no error messages displayed.
New in version 5.0.
License: Geosoft Open License
- classmethod file_date(file)[source]ΒΆ
File creation date in decimal years.
- Parameters:
file (str) β File name
- Returns:
Date in decimal years,
rDUMMY
if the file does not exist.- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: The FormatDate_STR function can be used to convert a date to a string.
- classmethod file_exist(file)[source]ΒΆ
Check to see if a file exists
- Parameters:
file (str) β Name of file to check
- Returns:
0 - File doesnβt exist 1 - File exists
- Return type:
int
New in version 5.0.
License: Geosoft Open License
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.
- classmethod file_ren(old_file, new_file)[source]ΒΆ
Rename a file
- Parameters:
old_file (str) β Old file name
new_file (str) β New file name
New in version 5.0.
License: Geosoft Open License
- classmethod file_size(file)[source]ΒΆ
Returns size of a file.
- Parameters:
file (str) β Name of file
- Returns:
0 none/error x Size
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod file_time(file)[source]ΒΆ
File creation time in decimal hours.
- Parameters:
file (str) β File name
- Returns:
Date in decimal hours,
rDUMMY
if the file does not exist.- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: The FormatTime_STR function can be used to convert a time to a string.
- classmethod file_to_clipboard(file)[source]ΒΆ
Copy a text file onto the clipboard as text.
- Parameters:
file (str) β File place into clipboard
New in version 5.0.
License: Geosoft Open License
- classmethod file_writable(file)[source]ΒΆ
Check if a file can be created or opened in read-write mode at a specific location
- Parameters:
file (str) β File path name to check
- Return type:
bool
New in version 6.2.
License: Geosoft Open License
- classmethod filter_parm_group(group, add)[source]ΒΆ
Controls filtering of specific group during logging.
- Parameters:
group (str) β Group Name
add (int) β 0 - Clear filter, 1 - Add filter
New in version 9.1.
License: Geosoft Open License
Note: This is useful to prevent certain utility GX parameters from being recorded during GS script runs where the parameters does not influence the actual script execution.
- classmethod find_files_vv(vv, mask)[source]ΒΆ
Fill a
GXVV
with files matching an input file mask.New in version 5.0.
License: Geosoft Open License
Note: Fill a
GXVV
with files matching the input file mask. TheGXVV
should be of string type.
- classmethod find_path(file, mode, fullname)[source]ΒΆ
Get full path for a file with Geosoft subdirectory parameter.
- Parameters:
file (str) β File to get path name for
mode (int) β SYS_SEARCH_PATH constants
fullname (str_ref) β Buffer to place path name into
- Returns:
0 if file found. 1 if file not found.
- Return type:
int
New in version 6.0.1.
License: Geosoft Open License
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
- classmethod find_path_ex(file, mode, dir_mode, fullname)[source]ΒΆ
Get full path for a file.
- Parameters:
file (str) β File to get path name for
mode (int) β SYS_SEARCH_PATH constants
dir_mode (int) β GEO_DIRECTORY constants
fullname (str_ref) β Buffer to place path name into
- Returns:
0 if file found. 1 if file not found.
- Return type:
int
New in version 6.0.1.
License: Geosoft Open License
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
- classmethod font_lst(lst, which)[source]ΒΆ
List all Windows and geosoft fonts.
- Parameters:
lst (GXLST) β List Object
which (int) β SYS_FONT constants
New in version 5.0.
License: Geosoft Open License
Note: To get TT and GFN fonts, call twice with the same list and
SYS_FONT_TT
, thenSYS_FONT_GFN
, or vice-versa to change order of listing.
- classmethod generate_guid(guid)[source]ΒΆ
Genrates a GUID string (e.g. {4FEDE8BF-CDAB-430A-8026-1CCC0EC0A2EB})
- Parameters:
guid (str_ref) β GUID
New in version 8.4.
License: Geosoft Open License
Automatically authenticate and navigate to my.geosoft.com URL
- Parameters:
url (str) β URL
New in version 9.4.
License: Geosoft Open License
- classmethod get_directory(sys_dir, dir)[source]ΒΆ
Get a directory path
- Parameters:
sys_dir (int) β SYS_DIR constants
dir (str_ref) β Returned directory path string
New in version 5.0.
License: Geosoft Open License
Note: The path will always end with the file separator character
- classmethod get_dot_net_gx_entries(gx, entry_buffer)[source]ΒΆ
Get the list of entry points that this assembly has exposed to Oasis montaj.
- Parameters:
gx (str) β Name of .NET GX assembly
entry_buffer (str_ref) β Buffer to place list of entries in
- Returns:
0 success 1 error.
- Return type:
int
New in version 6.0.1.
License: Geosoft Open License
Note: The list of entry points are passed back as one string with each entry point separated by a semi-colon. For example: NewGDB|Run;NewGDB|RunEx
- classmethod get_double(group, field)[source]ΒΆ
This method returns a real from the parameter block.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
- Returns:
Real Value,
rDUMMY
if parameter not set.- Return type:
float
New in version 6.0.1.
License: Geosoft Open License
- classmethod get_entitlement_rights(lst_rights)[source]ΒΆ
Get the Entitlement Rights
- Parameters:
lst_rights (GXLST) β Rights
New in version 9.0.
License: Geosoft Open License
- classmethod get_env(parm, set)[source]ΒΆ
Get an environment setting.
- Parameters:
parm (str) β Setting
set (str_ref) β Value string
New in version 5.0.
License: Geosoft Open License
- classmethod get_error_ap(err)[source]ΒΆ
Get the error number of an error.
- Parameters:
err (int) β The error index (0 to N-1, where N=number of registered errors)
- Returns:
The error number registered, 0 if none registered.
- Return type:
int
New in version 9.6.
License: Geosoft Open License
- classmethod get_error_message_ap(err, err_str)[source]ΒΆ
Return the error message text as a string.
- Parameters:
err (int) β The error index (0 to N-1, where N=number of registered errors)
err_str (str_ref) β Buffer to return message in
New in version 6.0.
License: Geosoft Open License
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
num_errors_ap
to get the number of registered errors.
- classmethod get_geodist()[source]ΒΆ
Gets a global flag that indicates whether we are running within the geodist library
- Returns:
0 - Geodist not loaded, 1 - Geodist loaded
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- classmethod get_geosoft_id(id)[source]ΒΆ
Get the Geosoft ID (email) if signed in
- Parameters:
id (str_ref) β Returned ID
New in version 9.4.
License: Geosoft Open License
- classmethod get_int(group, field)[source]ΒΆ
This method returns an int from the parameter block.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
- Returns:
Int Value,
iDUMMY
if the parameter is not set.- Return type:
int
New in version 6.0.1.
License: Geosoft Open License
- classmethod get_license_class(cl)[source]ΒΆ
Get the current application license class.
- Parameters:
cl (str_ref) β Class String
New in version 6.1.
License: Geosoft Open License
Note: String may be one of : βArcGISβ βOasisMontajβ βDapServerβ
- classmethod get_licensed_user(user, company)[source]ΒΆ
Get the licensed user name and Company
New in version 6.0.
License: Geosoft Open License
Get the loaded menus.
- Parameters:
New in version 9.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: The names of the LSTs contain the menus and the values contain any exclusions. Exclusions are semicolon separated top level menu names and/or toolbar.geobar file names.
- classmethod get_path(type, path)[source]ΒΆ
Get a Geosoft path
- Parameters:
type (int) β SYS_PATH constants
path (str_ref) β String in which to place path
New in version 5.0.
License: Geosoft Open License
Note: The path name will have a directory separator at the end.
- classmethod get_pattern(group, pat, size, thick, dense, col, back_col)[source]ΒΆ
Gets pattern parameters from the parameter block.
- Parameters:
New in version 6.4.
License: Geosoft Open License
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 color value. βPAT_BACKCOLORβ Background color value.Returned values may be DUMMY, but will be acceptable for use with the
GXGUI.color_form
function, to set defaults.
- classmethod get_profile_name(name)[source]ΒΆ
Get the profile name as defined in My Geosoft (or email if not defined)
- Parameters:
name (str_ref) β Returned name
New in version 9.4.
License: Geosoft Open License
- classmethod get_profile_url(url)[source]ΒΆ
Get link to my.geosoft.com profile URL
- Parameters:
url (str_ref) β Returned URL
New in version 9.4.
License: Geosoft Open License
- classmethod get_ptmp(ptmp)[source]ΒΆ
Get temporary saves copy of parameter block.
- Parameters:
ptmp (int) β Saved with Save_PTMP_SYS
New in version 5.0.
License: Geosoft Open License
See also
- classmethod get_publish_path_for_central(project_uuid, cache_path)[source]ΒΆ
Get cache path to publish datasets to Central
- Parameters:
project_uuid (str) β Project UUID
cache_path (str_ref) β Returned cache path
New in version 2021.2.
License: Geosoft Open License
- classmethod get_reg(reg, group)[source]ΒΆ
Get
GXREG
parameters.New in version 5.0.
License: Geosoft Open License
- classmethod get_settings_meta(meta)[source]ΒΆ
Get the settings metadata object.
New in version 6.0.
License: Geosoft Open License
- classmethod get_sys_info(sys_info, info)[source]ΒΆ
Get system information
- Parameters:
sys_info (int) β SYS_INFO constants
info (str_ref) β Returned setting
New in version 5.0.
License: Geosoft Open License
- classmethod get_thread_id()[source]ΒΆ
Get the ID the current thread.
- Returns:
x - ID
- Return type:
int
New in version 5.1.6.
License: Geosoft Open License
Note: In a single threaded application this will always be 0.
- classmethod get_timer(flag, start_time, elapsed_time)[source]ΒΆ
Return the elapsed time since the established time.
- Parameters:
- Returns:
Success if the delay has elapsed.
- Return type:
int
New in version 6.0.
License: Geosoft Open License
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.
- classmethod get_top_error_ap()[source]ΒΆ
Get the error number of the last registered error.
- Returns:
The top error number registered, 0 if none registered.
- Return type:
int
New in version 8.0.
License: Geosoft Open License
- classmethod get_windows_dir(dir)[source]ΒΆ
Get the Windows directory path
- Parameters:
dir (str_ref) β Buff for directory path string
New in version 5.0.
License: Geosoft Open License
- classmethod get_workspace_reg(reg)[source]ΒΆ
Get a copy of the workspace
GXREG
;New in version 5.0.
License: Geosoft Open License
Note: The workspace
GXREG
is separate from the reg used to storeGXSYS
parameters.Because
get_workspace_reg
returns a copy of the workspaceGXREG
, and not the workspaceGXREG
itself, you must callset_workspace_reg
if you make changes to your ownGXREG
object and you wish them to take effect in the workspaceGXREG
.
- classmethod get_yes_no(group, field)[source]ΒΆ
Check a YES/NO Setting
- Parameters:
group (str) β Group Name
field (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.
License: Geosoft Open License
- classmethod global_(parm, setting)[source]ΒΆ
Get a global parameter setting.
- Parameters:
parm (str) β Name of the Parameter
setting (str_ref) β Setting returned
- Returns:
0 if parameter found. 1 if parameter not found or not set.
- Return type:
int
New in version 6.0.1.
License: Geosoft Open License
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.
- classmethod global_reset(ini)[source]ΒΆ
Reset the global parameters.
- Parameters:
ini (str) β New INI file name, if ββ, use default.
New in version 5.0.
License: Geosoft Open License
- classmethod global_set(parm, set)[source]ΒΆ
Set a global parameter setting.
- Parameters:
parm (str) β Name of the Parameter
set (str) β Setting
New in version 5.0.
License: Geosoft Open License
- classmethod global_write(ini)[source]ΒΆ
Modify the global parameters.
- Parameters:
ini (str) β Global INI file, if ββ use default.
New in version 5.0.
License: Geosoft Open License
Note: If the global parameters have been changed, use this function to make the changes permanent,
- classmethod gt_string(group, field, buff)[source]ΒΆ
This method returns a string in the parameter block.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
buff (str_ref) β Buffer to place the string into
New in version 5.0.
License: Geosoft Open License
Note: If the setting exits it is placed in the buffer, otherwise the buffer will have zero length
- classmethod interactive()[source]ΒΆ
Checks to see if you should run interactively.
- Returns:
0 - Run in batch mode only 1 - Run Interactively only
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod is_encrypted_string(input)[source]ΒΆ
Checks whether the specified string was encrypted by
encrypt_string
.- Parameters:
input (str) β Input string to inspect.
- Returns:
0 (false) or non-zero (true)
- Return type:
int
New in version 9.0.
License: Geosoft Open License
- is_null()[source]ΒΆ
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- classmethod is_signed_in()[source]ΒΆ
Check if signed in via Geosoft Connect
- Return type:
bool
New in version 9.4.
License: Geosoft Open License
- classmethod load_parm(file, groups)[source]ΒΆ
Reads parameters from a file.
- Parameters:
file (str) β Name of the File to read from
groups (str) β Group Name to write read (ββ for all groups)
New in version 5.0.
License: Geosoft Open License
- classmethod log_background_task(location)[source]ΒΆ
This method logs that a background task was run
- Parameters:
location (str) β Location that launched the background task
New in version 2014.1.
License: Geosoft Open License
- classmethod log_script_run(location)[source]ΒΆ
This method logs that a script was run
- Parameters:
location (str) β Location that launched the script
New in version 9.2.
License: Geosoft Open License
- classmethod longto_date(days)[source]ΒΆ
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:
days (int) β Day
- Returns:
x - Date
- Return type:
float
New in version 6.3.
License: Geosoft Open License
- classmethod longto_time(sec)[source]ΒΆ
Converts seconds to decimal hours.
- Parameters:
sec (int) β Seconds
- Returns:
x - Time
- Return type:
float
New in version 6.3.
License: Geosoft Open License
- classmethod make_date(year, month, day)[source]ΒΆ
Returns the decimal date given the year, month and day.
- Parameters:
year (int) β Year
month (int) β Month (0-11)
day (int) β Day (0-30)
- Returns:
Date in decimal years.
- Return type:
float
New in version 5.1.1.
License: Geosoft Open License
- classmethod make_dir(dir)[source]ΒΆ
Create a directory.
- Parameters:
dir (str) β Name of directory
- Returns:
0 - Directory made 1 - Directory cannot be made
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod make_file_readonly(file)[source]ΒΆ
Set a fileβs read-only attribute.
- Parameters:
file (str) β Name of file
- Returns:
0 if read-only attribute successfully set, 1 if attribute change fails.
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- classmethod make_file_writable(file)[source]ΒΆ
Removes a fileβs read-only attribute.
- Parameters:
file (str) β Name of file
- Returns:
0 if read-only attribute successfully removed, 1 if attribute change fails.
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- classmethod num_errors_ap()[source]ΒΆ
Returns the number of registered errors.
- Returns:
The number of registered errors.
- Return type:
int
New in version 6.0.
License: Geosoft Open License
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
- classmethod ole_automation(object, info_str, info_val)[source]ΒΆ
Call OLE Automation designed to be called from Montaj.
- Parameters:
object (str) β Object Name
info_str (str) β Info String
info_val (int) β Info Int
- Returns:
Return from automation engine.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod prog_name(name, reset)[source]ΒΆ
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:
name (str) β New Process Name
reset (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
New in version 5.0.
License: Geosoft Open License
- classmethod prog_state()[source]ΒΆ
Return current progress state (On/Off)
- Return type:
int
New in version 7.2.
License: Geosoft Open License
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
- classmethod prog_update(perc)[source]ΒΆ
This method drives the Progress Bar. It is passed a percentage and will update the bar to reflect that percentage.
- Parameters:
perc (int) β Percentage Completed (0-100).
New in version 5.0.
License: Geosoft Open License
- classmethod prog_update_l(v1, v2)[source]ΒΆ
Updates progress bar based on count and maxcount.
- Parameters:
v1 (int) β Count
v2 (int) β Max count >= count
New in version 5.0.
License: Geosoft Open License
- classmethod progress(on)[source]ΒΆ
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:
on (int) β 0 - Turn Progress Bar OFF 1 - Turn Progress Bar ON
New in version 5.0.
License: Geosoft Open License
- classmethod prompt(title, result)[source]ΒΆ
Asks the User to enter a string.
- Parameters:
title (str) β Title of the window
result (str_ref) β Buffer to place the userβs string
- Returns:
0 - User hit OK 1 - user hit CANCEL
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: The User string is displayed as the default value in the prompt. Empty the user string if no default is needed.
- classmethod publish_datasets_to_central(instance_uuid, project_uuid, project_name, central_server_guid, central_branch_id, central_revision_id, metadata_as_json, parent_event_id)[source]ΒΆ
Publish datasets to Central
- Parameters:
instance_uuid (str) β Central Instance UUID
project_uuid (str) β Project UUID
project_name (str) β Project name
central_server_guid (str_ref) β Central server GUID
central_branch_id (int_ref) β Branch ID
central_revision_id (int_ref) β Revision ID
metadata_as_json (str) β metadata as JSON
parent_event_id (str) β Parent Event ID
New in version 2021.2.
License: Geosoft Open License
- classmethod registry_delete_key(domain, key)[source]ΒΆ
Delete a registry value
- Parameters:
domain (int) β REG_DOMAIN constants
key (str) β Key to delete
- Returns:
0 - Ok 1 - Error
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: All sub-keys and values will be deleted if they exist.
- classmethod registry_delete_val(domain, key, value_name)[source]ΒΆ
Delete a registry value
- Parameters:
domain (int) β REG_DOMAIN constants
key (str) β Key
value_name (str) β Name of value to delete
- Returns:
0 - Ok 1 - Error
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- classmethod registry_get_val(domain, key, sub_key, value)[source]ΒΆ
Get a registry value
- Parameters:
domain (int) β REG_DOMAIN constants
key (str) β Key to set
sub_key (str) β Value name within key
value (str_ref) β String for value data
- Returns:
0 if value exists 1 if value does not exist
- Return type:
int
New in version 6.0.1.
License: Geosoft Open License
- classmethod registry_set_val(domain, key, sub_key, value)[source]ΒΆ
Set/create a registry value
- Parameters:
domain (int) β REG_DOMAIN constants
key (str) β Key to set
sub_key (str) β Name of Subkey within key
value (str) β Value for Subkey
New in version 5.0.
License: Geosoft Open License
Note: This function will create the subkey and key if either do not already exist.
- classmethod relative_file_name(abbr, name)[source]ΒΆ
Convert a file name to a relative abbreviated path name
- Parameters:
abbr (str) β Input file name to resolve
name (str_ref) β Output name, can be the same as input
New in version 6.0.1.
License: Geosoft Open License
Note: This will produce relative paths based on the workspace directory into β.nameβ.
- classmethod remove_lineage_output(output_name)[source]ΒΆ
Remove an output from the current lineage object
- Parameters:
output_name (str) β Source Name
New in version 7.0.1.
License: Geosoft Open License
- classmethod remove_lineage_parameter(name)[source]ΒΆ
Remove a parameter in the current lineage object
- Parameters:
name (str) β Paramter Name
New in version 7.0.
License: Geosoft Open License
- classmethod remove_lineage_source(source_name)[source]ΒΆ
Remove a source from the current lineage object
- Parameters:
source_name (str) β Source Name
New in version 7.0.
License: Geosoft Open License
- classmethod replace_string(str_val, output, group)[source]ΒΆ
Replace β% %β tokens in a string with parameter values
- Parameters:
str_val (str) β String to filter replace
output (str_ref) β Output string
group (str) β Default group name
New in version 5.0.
License: Geosoft Open License
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.
- classmethod reset_settings()[source]ΒΆ
Resets the GX_HELP settings in the geosoft.ini file after changes have been made.
New in version 5.1.8.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod restore_geo_file(target, original)[source]ΒΆ
Backup a Geosoft data file and all associated files to original location
- Parameters:
target (str) β Backup File Name
original (str) β Original file name
New in version 7.0.
License: Geosoft End-User License
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.
- classmethod run(command, args, process)[source]ΒΆ
Run a command line process.
- Parameters:
command (str) β Command name
args (str) β Command line arguments
process (int) β Flags SYS_RUN_TYPE constants SYS_RUN_DISPLAY constants SYS_RUN_HOLD constants SYS_RUN_WIN constants
- Returns:
-1 if failed to execute task Exit status of the task
- Return type:
int
New in version 5.0.
License: Geosoft Open License
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:
the local working directory
the <geosoft>bin directory
the system path
- classmethod run_gs(gs)[source]ΒΆ
Run a GS.
- Parameters:
gs (str) β Name of GS to run.
- Returns:
Exit status of the GS -1 cancelled 0 success 1 ended with an error.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
See also
- classmethod run_gx(gx)[source]ΒΆ
Run a GX.
- Parameters:
gx (str) β Name of GX to run.
- Returns:
Exit status of the GX: -1 cancelled 0 success 1 ended with an error.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: If the called GX returns an error, they will not be displayed until the βtopβ calling GX terminates, unless you call
show_error
.See also
- classmethod run_multi_user_script(script, users, iterations, wait_min_time, wait_max_time, ramp_up_time)[source]ΒΆ
Execute a script using multithreaded users
- Parameters:
script (str) β Script to run
users (int) β Number of users to run
iterations (int) β Number of iterations to run (for each user)
wait_min_time (int) β Minimum wait time between iterations (0 for none)
wait_max_time (int) β Maximum wait time between iterations (0 for none)
ramp_up_time (int) β Ramp up time for users (0 for all users start immediatly)
New in version 5.1.6.
License: Geosoft Open License
Note: No access is provided in the script to EMAPS or EDBS. Users must ensure that the resources that are shared are protected.
- classmethod run_pdf(mnu, pdf)[source]ΒΆ
Run a PDF.
- Parameters:
mnu (str) β Group name, can be ββ.
pdf (str) β PDF name (.pdf assumed)
- Returns:
Exit status: -1 cancelled 0 success 1 ended with an error.
- Return type:
int
New in version 5.0.
License: Geosoft End-User License
Limitations: May not be available while executing a command line program.
Note: The group name of the PDF variables will be βgroup_pdfβ, where βgroupβ is the name given in the first argument, and βpdfβ is the root PDF file name.
- classmethod run_python(gx, init_info)[source]ΒΆ
Run a Python GX script with initialization information.
- Parameters:
gx (str) β Name of Python GX to run.
init_info (str) β Initialization information (usually JSON). Available withon Python script as a global variable named gx_init_info.
- Returns:
Exit status of the GX: -1 cancelled 0 success 1 ended with an error.
- Return type:
int
New in version 9.9.
License: Geosoft Open License
- classmethod save_log(file)[source]ΒΆ
Saves the main log file to another file.
- Parameters:
file (str) β Output file name
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod save_parm(file, mode, groups)[source]ΒΆ
Writes out one group (or all groups) to a file.
- Parameters:
file (str) β Name of the File
mode (int) β 0 - New file, 1 - Append
groups (str) β Group Name to write out (ββ for all groups)
New in version 5.0.
License: Geosoft Open License
- classmethod save_ptmp(groups)[source]ΒΆ
Save a temporary copy of the parameter block.
- Parameters:
groups (str) β Group Name to save, ββ for everything.
- Returns:
PTMP handle.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: All PTMP instances will be destroyed on exit.
See also
- classmethod script()[source]ΒΆ
Checks to see if we are running inside OMS (script mode)
- Returns:
0 - Normal mode 1 - Scripting mode
A number of functions can only be run from inside Oasis montaj (such as
GXEMAP.get_display_area_raw
), 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.
License: Geosoft Open License
- classmethod script_record()[source]ΒΆ
Checks to see if we are in scripting recording mode
- Returns:
0 - Normal mode 1 - Recording mode
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- classmethod secondsto_time(sec)[source]ΒΆ
Converts fractional seconds to decimal hours.
- Parameters:
sec (float) β Seconds
- Returns:
x - Time
- Return type:
float
New in version 6.3.
License: Geosoft Open License
- classmethod send_general_message(cl, info)[source]ΒΆ
Send a general information message to all listners
- Parameters:
cl (str) β Message Class
info (str) β Message Info
New in version 6.3.
License: Geosoft Open License
- classmethod set_background_run(mode)[source]ΒΆ
Sets the environment as running in the background.
- Parameters:
mode (int) β 1 - background run is true, 0 background run is false
New in version 2024.1.
License: Geosoft Open License
- classmethod set_cursor(cursor)[source]ΒΆ
Set the cursor on the display.
- Parameters:
cursor (str) β Cursor Names
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Possible Cursors: Normal, Horiz, Vert, Moving, Cross, Hand, NoEdit, Sun, View, Group, ViewSel, GroupSel, BoxSelect, Shadow, Link, Line, PolyLine, Polygon, Ellipse, Rectangle, Text, Symbol, Zoom, Pan, Rotate, InteractiveZoom, PolyFill, GetFill, SnapPoint, SnapLine, SnapOnPoint, SnapOnLine, NPolygon, ExcludeRect, ExcludePoly, ExcludeNPoly, AddVertex, DelVertex, GeneralAdd and GeneralDelete
- classmethod set_double(group, field, val)[source]ΒΆ
This method Sets a real in the parameter block.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
val (float) β Real
New in version 5.0.
License: Geosoft Open License
- classmethod set_env(parm, set)[source]ΒΆ
Set an environment setting.
- Parameters:
parm (str) β Setting
set (str) β Value
New in version 5.0.
License: Geosoft Open License
- classmethod set_info_line(message)[source]ΒΆ
Display a message on the information line at the left bottom corner of the OAISIS montaj application.
- Parameters:
message (str) β Message String
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod set_int(group, field, val)[source]ΒΆ
This method sets an int in the parameter block.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
val (int) β Int Value to Set
New in version 5.0.
License: Geosoft Open License
- classmethod set_interactive(mode)[source]ΒΆ
Sets the interactive mode.
- Parameters:
mode (int) β 0 - interactive off 1 - interative on
New in version 5.0.
License: Geosoft Open License
Note: Call to
interactive
will return the value set here.See also
interactive
,run_gx
andrun_gs
- classmethod set_lineage_description(description)[source]ΒΆ
Set the description for the current lineage object
- Parameters:
description (str) β Description
New in version 7.0.
License: Geosoft Open License
- classmethod set_lineage_display_name(display_name)[source]ΒΆ
Set the display name for the current lineage object
- Parameters:
display_name (str) β DisplayName
New in version 7.0.
License: Geosoft Open License
- classmethod set_lineage_name(name)[source]ΒΆ
Set the name for the current lineage object
- Parameters:
name (str) β Name
New in version 7.0.
License: Geosoft Open License
Load a list of menus
- Parameters:
lst_default (GXLST) β Default menus (typically a single entry based on product, do not change the name returned by
get_loaded_menus
)lst_loaded (GXLST) β Loaded menus
lst_user (GXLST) β Loaded user menus
New in version 9.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: The names of the LSTs contain the menus and the values contain any exclusions. Exclusions are semicolon separated top level menu names and/or toolbar.geobar file names.
- classmethod set_pattern(group, pat, size, thick, dense, col, back_col)[source]ΒΆ
Sets pattern parameters in the parameter block.
- Parameters:
group (str) β Group Name
pat (int) β Pattern
size (float) β Size. Input
GS_R8DM
to use defaultthick (int) β Thickness (0-100). Input
GS_S4DM
to use defaultdense (float) β Density. Input
GS_R8DM
to use defaultcol (int) β Pattern Color
back_col (int) β Background Color. Can be
C_TRANSPARENT
New in version 6.4.
License: Geosoft Open License
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 color value. βPAT_BACKCOLORβ Background color value.
Input values may be DUMMY.
Designed for use along with the sPatternForm_GUI function.
- classmethod set_reg(reg)[source]ΒΆ
Copy contents of a
GXREG
to current parameters.New in version 5.0.
License: Geosoft Open License
- classmethod set_server_messages_ap(flag)[source]ΒΆ
Control the server message handling.
- Parameters:
flag (int) β 1 - Display messages, 0 - messages reported as errors
New in version 6.2.
License: Geosoft Open License
Note: Should be set to false when dialogs should not appear. This setting is thread specific.
- classmethod set_settings_meta(meta)[source]ΒΆ
Set the settings metadata object.
New in version 6.0.
License: Geosoft Open License
- classmethod set_string(group, field, val)[source]ΒΆ
This method sets a string in the parameter block.
- Parameters:
group (str) β Group Name
field (str) β Parameter Name
val (str) β String to Set it To
New in version 5.0.
License: Geosoft Open License
- classmethod set_workspace_reg(reg)[source]ΒΆ
Set the workspace
GXREG
;New in version 5.0.
License: Geosoft Open License
Note: The workspace
GXREG
is separate from the reg used to storeGXSYS
parameters.Because
get_workspace_reg
returns a copy of the workspaceGXREG
, and not the workspaceGXREG
itself, you must callset_workspace_reg
if you make changes to your ownGXREG
object and you wish them to take effect in the workspaceGXREG
- classmethod shell_execute(verb, file, parameters, directory, show)[source]ΒΆ
Call Microsoft ShellExecute function (See MSDN)
- Parameters:
verb (str) β Verb
file (str) β File
parameters (str) β Parameters
directory (str) β Directory
show (int) β SHELL_EXECUTE constants
- Returns:
return value of ShellExecute as documented on MSDN
- Return type:
int
New in version 5.0.
License: Geosoft Open License
See also
- classmethod short_path_file_name(in_name, name)[source]ΒΆ
Obtains the short path form of a specified input path.
- Parameters:
in_name (str) β Input file name to resolve
name (str_ref) β Output name, can be the same as input
New in version 5.0.
License: Geosoft Open License
- classmethod sign_in()[source]ΒΆ
Sign in via Geosoft Connect
New in version 9.4.
License: Geosoft Open License
- classmethod temp_file_ext(ext, out)[source]ΒΆ
Generate a unique file name for this extension in the temp directory.
- Parameters:
ext (str) β Input extension (without .)
out (str_ref) β Output name
New in version 5.1.8.
License: Geosoft Open License
Note: This is useful for created a unique tempory name for a file in the Geosoft temporary directory.
- classmethod temp_file_name(path_file, out_filename)[source]ΒΆ
Generate a file name for this file in the temp directory.
- Parameters:
path_file (str) β Input file name to resolve (path is removed)
out_filename (str_ref) β Output name, can be the same as input
New in version 5.0.
License: Geosoft Open License
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.
- classmethod terminate(name)[source]ΒΆ
DLL error termination
- Parameters:
name (str) β Module name
New in version 5.0.
License: Geosoft Open License
Note: Call this function immediately before returning to the caller after an error has occurred inside the DLL. If an error has occurred, you should clean-up (free memory, close files), call
error
to register your own error messages, callerror_tag
to set any error message tags, callterminate
and return.Geosoft functions that detect an error will have already registered their own errors and called
terminate
.
- classmethod testing_system_mode()[source]ΒΆ
Checks to see if the GX is running in the Geosoft testing system.
- Returns:
0 - Normal operation 1 - Running in the Geosoft testing system.
- Return type:
int
New in version 9.6.
License: Geosoft Open License
- classmethod time()[source]ΒΆ
Returns the current time in decimal hours.
- Returns:
Time in decimal hours.
- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: The FormatTime_STR function can be used to convert a time to a string.
- classmethod timeto_long(time)[source]ΒΆ
Converts decimal hours to seconds in a day.
- Parameters:
time (float) β Time
- Returns:
x - Seconds (integer)
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- classmethod timeto_seconds(time)[source]ΒΆ
Converts decimal hours to seconds in a day fractional
- Parameters:
time (float) β Time
- Returns:
x - Number of seconds with fractions
- Return type:
float
New in version 6.3.
License: Geosoft Open License
- classmethod transfer_path(path_file, file)[source]ΒΆ
Transfers file path to new file name.
- Parameters:
path_file (str) β Input file path/name
file (str_ref) β Output file name with path transfered
New in version 5.1.8.
License: Geosoft Open License
Note: The path and volume of from the input string is added to file name from the output string.
- classmethod utc_date()[source]ΒΆ
Returns the current UTC date in decimal years.
- Returns:
Date in decimal years.
- Return type:
float
New in version 7.0.
License: Geosoft Open License
Note: The FormatDate_STR function can be used to convert a date to a string.
- classmethod utc_file_date(file)[source]ΒΆ
File creation UTC date in decimal years.
- Parameters:
file (str) β File name
- Returns:
Date in decimal years,
rDUMMY
if the file does not exist.- Return type:
float
New in version 7.0.
License: Geosoft Open License
Note: The FormatDate_STR function can be used to convert a date to a string.
- classmethod utc_file_time(file)[source]ΒΆ
File creation UTC time in decimal hours.
- Parameters:
file (str) β File name
- Returns:
Date in decimal hours,
rDUMMY
if the file does not exist.- Return type:
float
New in version 7.0.
License: Geosoft Open License
Note: The FormatTime_STR function can be used to convert a time to a string.
- classmethod utc_time()[source]ΒΆ
Returns the current UTC time in decimal hours.
- Returns:
Time in decimal hours.
- Return type:
float
New in version 7.0.
License: Geosoft Open License
Note: The FormatTime_STR function can be used to convert a time to a string.
- classmethod valid_file_name(file)[source]ΒΆ
Check to see if a file name valid
- Parameters:
file (str) β Name of file to check
- Returns:
0 - File name is not valid 1 - File name is valid
- Return type:
int
New in version 5.0.
License: Geosoft Open License
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.
- classmethod write_debug_log(log)[source]ΒΆ
This method writes out information to the output debugging log file (in temp folder) or output window.
- Parameters:
log (str) β String to Write out
New in version 6.3.
License: Geosoft Open License
- classmethod write_in_dir(dir)[source]ΒΆ
Can I create files in this directory ?
- Parameters:
dir (str) β Name of directory to check
- Returns:
0 - Directory doesnβt allow write of does not exist 1 - Directory allows writes
- Return type:
int
New in version 5.0.
License: Geosoft Open License
ARC_LICENSE constantsΒΆ
ArcGIS platform types
GEO_DIRECTORY constantsΒΆ
Geosoft directory defines
- GEO_DIRECTORY_USER_TEMPΒΆ
Geosoft\temp (or where the user put it)
- gxapi.GEO_DIRECTORY_USER_TEMP = 17ΒΆ
REG_DOMAIN constantsΒΆ
Registry key domains
SHELL_EXECUTE constantsΒΆ
Shell execute defines
SYS_DIR constantsΒΆ
GXSYS
Directory locations
- SYS_DIR_USERΒΆ
is the geosoft installation directory that contains user read/write files.
- gxapi.SYS_DIR_USER = 2ΒΆ
- SYS_DIR_GEOSOFT_ENCRYPTEDFILESΒΆ
Encrypted Files folder
- gxapi.SYS_DIR_GEOSOFT_ENCRYPTEDFILES = 106ΒΆ
- SYS_DIR_GEOSOFT_MAPTEMPLATEΒΆ
GXMAPTEMPLATE
folder- gxapi.SYS_DIR_GEOSOFT_MAPTEMPLATE = 115ΒΆ
- SYS_DIR_USER_MAPTEMPLATEΒΆ
User
GXMAPTEMPLATE
Folder- gxapi.SYS_DIR_USER_MAPTEMPLATE = 206ΒΆ
SYS_FONT constantsΒΆ
Font types
SYS_FILE_FORM constantsΒΆ
File Open Mode
SYS_DAT_FILE constantsΒΆ
DAT File Type
SYS_INFO constantsΒΆ
System information
SYS_LINEAGE_SOURCE constantsΒΆ
Type of lineage sources
SYS_PATH constantsΒΆ
Get specific Geosoft paths. The path name will have a directory separator at the end.
- SYS_PATH_GEOSOFT_USERΒΆ
is the geosoft installation directory that contains user read/write files.
- gxapi.SYS_PATH_GEOSOFT_USER = 2ΒΆ
- SYS_PATH_GEOSOFT_ENCRYPTEDFILESΒΆ
Encrypted Files folder
- gxapi.SYS_PATH_GEOSOFT_ENCRYPTEDFILES = 106ΒΆ
- SYS_PATH_GEOSOFT_MAPTEMPLATEΒΆ
GXMAPTEMPLATE
folder- gxapi.SYS_PATH_GEOSOFT_MAPTEMPLATE = 115ΒΆ
- SYS_PATH_GEOSOFT_USER_MAPTEMPLATEΒΆ
User
GXMAPTEMPLATE
Folder- gxapi.SYS_PATH_GEOSOFT_USER_MAPTEMPLATE = 206ΒΆ
SYS_RUN_DISPLAY constantsΒΆ
Windows Display Options Determine how applications are started. These options are not yet implemented.
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.
SYS_RUN_TYPE constantsΒΆ
Type of application to run
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.
SYS_SEARCH_PATH constantsΒΆ
Find File define
SYS_ENCRYPTION_KEY constantsΒΆ
How to encrypt a string. Determines the portability of the encrypted string.
TD_ICON constantsΒΆ
TaskDialog Icon
TD_ID constantsΒΆ
TaskDialog Common Button Return Values
- TD_ID_OKΒΆ
TD_BUTTON_OK
pressed.- gxapi.TD_ID_OK = 1ΒΆ
- TD_ID_CANCELΒΆ
TD_BUTTON_CANCEL
pressed.- gxapi.TD_ID_CANCEL = 2ΒΆ
- TD_ID_RETRYΒΆ
TD_BUTTON_RETRY
pressed.- gxapi.TD_ID_RETRY = 4ΒΆ
- TD_ID_YESΒΆ
TD_BUTTON_YES
pressed.- gxapi.TD_ID_YES = 6ΒΆ
- TD_ID_NOΒΆ
TD_BUTTON_NO
pressed.- gxapi.TD_ID_NO = 7ΒΆ
- TD_ID_CLOSEΒΆ
TD_BUTTON_CLOSE
pressed.- gxapi.TD_ID_CLOSE = 8ΒΆ