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_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
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_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_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_gx_ex
(gx, ret)[source]¶ Run a GX.
- Parameters
gx (str) – Name of GX to run.
ret (int_ref) – Return value set in the child GX (0 by default)
- 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
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 of the task, 0 usually means success.
- 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
Return value of the GX set by
set_return
(0 by default). Terminates on error or cancel.- Return type
int
New in version 9.9.
License: Geosoft Open License
See also
-
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_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_return
(ret)[source]¶ Set the return value of a GX.
- Parameters
ret (int) – Return Value
New in version 5.0.
License: Geosoft Open License
Note: This value is returned in the
run_gx_ex
call only.
-
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
-
classmethod
ARC_LICENSE constants¶
ArcGIS platform types
GEO_DIRECTORY constants¶
Geosoft directory defines
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_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_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_BUTTON constants¶
TaskDialog Common Buttons
-
TD_BUTTON_CANCEL
¶ Button results in
TD_ID_CANCEL
return value.-
gxapi.
TD_BUTTON_CANCEL
= 8¶
-
-
TD_BUTTON_RETRY
¶ Button results in
TD_ID_RETRY
return value.-
gxapi.
TD_BUTTON_RETRY
= 16¶
-
-
TD_BUTTON_CLOSE
¶ Button results in
TD_ID_CLOSE
return value.-
gxapi.
TD_BUTTON_CLOSE
= 32¶
-
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¶
-