GXPROJ class¶
-
class
geosoft.gxapi.
GXPROJ
¶ Project functions
-
static
add_document
((str)arg1, (str)arg2, (int)arg3) → int:¶ Adds (and opens) a document file in the current project.
Parameters: - arg1 (str) – Document name
- arg2 (str) – Type of document to add
- arg3 (int) – PROJ_DISPLAY constants
Returns: 0 - Ok 1 - Error
Return type: int
New in version 5.0.0.
Note:
The passed file name must be a valid file name complete with an extension and qualifiers (if applicable). The type string can be one of the following: Database Save and close only databases. Map Save and close only maps. Grid Save and close only grids.
-
static
add_document_without_opening
((str)arg1, (str)arg2) → int:¶ Adds (and opens) a document file in the current project.
Parameters: - arg1 (str) – Document name
- arg2 (str) – Type of document to add
Returns: 0 - Ok 1 - Error
Return type: int
New in version 8.5.0.
Note:
The passed file name must be a valid file name complete with an extension and qualifiers (if applicable). The type string can be one of the following: Database Save and close only databases. Map Save and close only maps. Grid Save and close only grids. Voxel Voxel file.
-
static
current_document
((str_ref)arg1, (str_ref)arg2) → None:¶ Get the name and type of the loaded document with focus.
Parameters: - arg1 (
geosoft.gxapi.str_ref
) – name (empty if none currenlty loaded) - arg2 (
geosoft.gxapi.str_ref
) – type
Returns: Nothing.
Return type: None
New in version 9.2.0.
- arg1 (
-
static
current_document_of_type
((str_ref)arg1, (str)arg2) → None:¶ Get the name loaded document of a specific type.
Parameters: - arg1 (
geosoft.gxapi.str_ref
) – name (empty if none currenlty loaded) - arg2 (str) – type
Returns: Nothing.
Return type: None
New in version 9.2.0.
- arg1 (
-
static
drop_map_clip_data
((int)arg1) → None:¶ Drop Map clipboard data in the current project (workspace background)
Parameters: arg1 (int) – Handle to Global Clipboard data Returns: Nothing Return type: None New in version 5.0.0.
-
static
get_command_environment
() → int:¶ The current command environment
Returns: COMMAND_ENV constants Notes We are moving towards embedded tools and menus and this setting can be set queried from the project to determine how specific commands should react. ly 3D viewer is currently making use of this.
Return type: int New in version 5.0.0.
-
static
get_name
((str_ref)arg1) → None:¶ Return the name of the project file.
Parameters: arg1 ( geosoft.gxapi.str_ref
) – nameReturns: Nothing. Return type: None New in version 8.4.0.
Note:
Return the name of the project file.
-
static
list_documents
((GXVV)arg1, (str)arg2) → int:¶ Fills a VV with documents of a certain type.
Parameters: - arg1 (
geosoft.gxapi.GXVV
) – VV of type -STR_FILE - arg2 (str) – Type of document to obtain
Returns: The number of documents listed in the VV.
Return type: int
New in version 5.0.0.
Note:
The type string can be one of the following: Database List Databases. Grid List Grids. Map List Maps. 3DView List 3D Views. Voxel List Voxels. VoxelInversion List VOXI Documents. MXD List ArcGIS MXDs. GMS3D List GM-SYS 3D Models. GMS2D List GM-SYS 2D Models. All Lists all files.
- arg1 (
-
static
list_loaded_documents
((GXVV)arg1, (str)arg2) → int:¶ Fills a VV with loaded documents of a certain type.
Parameters: - arg1 (
geosoft.gxapi.GXVV
) – VV of type -STR_FILE> - arg2 (str) – Type of document to obtain
Returns: The number of loaded documents listed in the VV.
Return type: int
New in version 9.2.
Note:
The type string can be one of the following: Database List Databases. Grid List Grids. Map List Maps. 3DView List 3D Views. Voxel List Voxels. VoxelInversion List VOXI Documents. MXD List ArcGIS MXDs. GMS3D List GM-SYS 3D Models. GMS2D List GM-SYS 2D Models. All Lists all files.
- arg1 (
-
static
list_tools
((GXLST)arg1, (int)arg2) → int:¶ Fills an LST object with tools of a certain type and notes the current visibility setting.
Parameters: - arg1 (
geosoft.gxapi.GXLST
) – LST object to hold list - arg2 (int) – TOOL_TYPE constants
Returns: The number of tools found.
Return type: int
New in version 5.0.0.
Note:
GX will terminate if there is an error. LST object will hold the tool name in the name column and include whether the tool is currently visible in the value column (1=visible, 0-hidden).
- arg1 (
-
static
remove_document
((str)arg1) → int:¶ Removes (and closes if visible) a document from the current project.
Parameters: arg1 (str) – Document name Returns: 0 - Ok 1 - Document not found in project Return type: int New in version 5.0.0.
Note:
The passed file name must be a valid file name complete with an extension and qualifiers (if applicable).
-
static
remove_tool
((str)arg1) → int:¶ Removes (and closes if visible) a auxiliary tool from the current project.
Parameters: arg1 (str) – Tool name Returns: 0 - Ok 1 - Tool not found in project Return type: int New in version 5.0.0.
Note:
Nothing
-
static
save_close_documents
((str)arg1) → int:¶ Saves and closes (if visible) documents contained in the current project.
Parameters: arg1 (str) – Type of document to save / close Returns: 0 - Ok -1 - User hit cancel in save dialog 1 - Error Return type: int New in version 5.0.0.
Note:
This wrapper brings up the save dialog tool to allow the user to save the modified documents for this project. Only documents that have actually changed will be listed. The type string can be one of the following: Database Save and close only databases. Map Save and close only maps. Grid Save and close only grids. All Saves and closes all files.
-
static
COMMAND_ENV constants¶
Command environments
-
gxapi.
COMMAND_ENV_NORMAL
= 0¶
Normal
-
gxapi.
COMMAND_ENV_IN3DVIEWER
= 1¶
Executing from inside 3D Viewer