GXEMAPTEMPLATE class¶
- class GXEMAPTEMPLATE(handle=0)[source]¶
GXEMAPTEMPLATE class.
The
GXEMAPTEMPLATE
class provides access to a map template as displayed within Oasis montaj, but does not change data within the template itself. It performs functions such as setting the currently displayed area, or drawing “tracking” lines or boxes on the template (which are not part of the template itself).Note:
To obtain access to the map template itself, it is recommended practice to begin with an
GXEMAPTEMPLATE
object, and use the Lock function to lock the underlying template to prevent external changes. The returnedGXMAPTEMPLATE
object may then be safely used to make changes to the template itself.VIRTUAL
GXEMAPTEMPLATE
SUPPORTThese methods are only available when running in an external application. They allow the GX to open a map template and then create a Virtual
GXEMAPTEMPLATE
from that map template. The GX can then call MakeCurrent and set the currentGXEMAPTEMPLATE
so that code that follows sees this map template as the currentGXMAPTEMPLATE
.Supported methods on Virtual EMAPTEMPLATEs are:
- classmethod create_virtual(name)[source]¶
Makes this
GXEMAPTEMPLATE
object the current active object to the user.- Parameters:
name (str) – Name of map to create a virtual EMAMTEMPLATE from
- Returns:
GXEMAPTEMPLATE
Object- Return type:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod current()[source]¶
This method returns the Current Edited map template.
- Returns:
GXEMAPTEMPLATE
Object- Return type:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod current_if_exists()[source]¶
This method returns the Current Edited map.
- Returns:
GXEMAPTEMPLATE
Object to current edited map. If there is no current map, the user is not prompted for a map, and 0 is returned.- Return type:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod current_no_activate()[source]¶
This method returns the Current Edited map template.
- Returns:
GXEMAPTEMPLATE
Object- Return type:
New in version 9.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This function acts just like
current
except that the document is not activated (brought to foreground) and no guarantee is given about which document is currently active.
- drag_drop_enabled()[source]¶
Checks if drag-and-drop is enabled for the map
- Return type:
bool
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- get_box(state, min_x, min_y, max_x, max_y)[source]¶
Returns the coordinates of a user selected box.
- Parameters:
- Returns:
0 if point returned. 1 if user cancelled.
- 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 coordinates are returned in the current template units (See GetUnits and SetUnits in
GXMAPTEMPLATE
)
- get_display_area(min_x, min_y, max_x, max_y)[source]¶
Get the area you are currently looking at.
- Parameters:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: The coordinates are based on the current template units (See GetUnits and SetUnits in
GXMAPTEMPLATE
)
- get_item_selection(item)[source]¶
Gets info about the current selected item
- Parameters:
item (str_ref) – returned item name
- Returns:
Returns
True
if the item is a view- Return type:
bool
New in version 5.0.
License: Geosoft End-User License
Limitations: May not be available while executing a command line program.
Note: If nothing is selected the string will be empty and the function will return
False
- get_line(str_val, min_x, min_y, max_x, max_y)[source]¶
Returns the end points of a line.
- Parameters:
- Returns:
0 if line returned. 1 if user cancelled.
- 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 coordinates are returned in the current template units (See GetUnits and SetUnits in
GXMAPTEMPLATE
)
- classmethod get_map_templates_lst(lst, path)[source]¶
Load the file names of open maps into a
GXLST
.- Parameters:
path (int) – EMAPTEMPLATE_PATH constants
- Returns:
The number of documents loaded into the
GXLST
. TheGXLST
is cleared first.- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- get_name(name)[source]¶
Get the name of the map object of this
GXEMAPTEMPLATE
.- Parameters:
name (str_ref) – Name returned
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- get_point(str_val, x, y)[source]¶
Returns the coordinates of a user selected point.
- Parameters:
- Returns:
0 if point returned. 1 if user cancelled.
- 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 coordinates are returned in the current template units (See GetUnits and SetUnits in
GXMAPTEMPLATE
)
- get_rect(str_val, min_x, min_y, max_x, max_y)[source]¶
Returns the coordinates of a user selected box starting at a corner.
- Parameters:
- Returns:
0 if point returned. 1 if user cancelled.
- 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 coordinates are returned in the current template units (See GetUnits and SetUnits in
GXMAPTEMPLATE
)
- get_template_layout_props(snap_to_grid, snap_dist, view_grid, view_rulers, view_units, grid_red, grid_green, grid_blue)[source]¶
Get the base layout view properties.
- Parameters:
snap_to_grid (bool_ref) – Snap to grid
snap_dist (float_ref) – Snapping distance (always in mm)
view_grid (int_ref) – View Grid
view_rulers (int_ref) – View Rulers
view_units (int_ref) – LAYOUT_VIEW_UNITS constants View Units
grid_red (int_ref) – Grid Red Component (0-255)
grid_green (int_ref) – Grid Green Component (0-255)
grid_blue (int_ref) – Grid Blue Component (0-255)
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This affects the display units and other related properties for the base view of a map.
- get_window_position(left, top, right, bottom, state, is_floating)[source]¶
Get the map window’s position and dock state
- Parameters:
left (int_ref) – Window left position
top (int_ref) – Window top position
right (int_ref) – Window right position
bottom (int_ref) – Window bottom position
state (int_ref) – Window state EMAPTEMPLATE_WINDOW_STATE constants
is_floating (int_ref) – Docked or floating EMAPTEMPLATE_WINDOW_POSITION constants
New in version 9.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- get_window_state()[source]¶
Retrieve the current state of the map window
- Returns:
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod have_current()[source]¶
This method returns whether a current map is loaded
- Returns:
0 - no current map. 1 - current map
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod i_get_specified_map_name(field, value, name)[source]¶
Find a loaded map that has a setting in its reg.
- Parameters:
- Returns:
0 - Ok 1 - No Map Found
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- is_locked()[source]¶
Is this MapTemplate locked
- Return type:
bool
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- 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 load(name)[source]¶
Loads maps into the editor.
- Parameters:
name (str) – list of maps (‘;’ or ‘|’ delimited) to load.
- Returns:
GXEMAPTEMPLATE
Object to edited map.- Return type:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: The last map in the list will be the current map.
Maps may already be loaded.
Only the first file in the list may have a directory path. All other files in the list are assumed to be in the same directory as the first file.
- classmethod load_no_activate(name)[source]¶
Loads documents into the workspace
- Parameters:
name (str) – List of documents (‘;’ or ‘|’ delimited) to load.
- Returns:
Handle to current edited document, which will be the last database in the list if multiple files were provided.
- Return type:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This function acts just like
load
except that the document(s) is not activated (brought to foreground) and no guarantee is given about which document is currently active.
- classmethod loaded(name)[source]¶
Returns 1 if a map is loaded .
- Parameters:
name (str) – map name
- Returns:
1 if map is loaded, 0 otherwise.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- lock()[source]¶
This method locks the Edited map.
- Returns:
GXMAPTEMPLATE
Object to map associated with edited map.- Return type:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- make_current()[source]¶
Makes this
GXEMAPTEMPLATE
object the current active object to the user.New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod null()[source]¶
A null (undefined) instance of
GXEMAPTEMPLATE
- Returns:
A null
GXEMAPTEMPLATE
- Return type:
- read_only()[source]¶
Checks if a map is currently opened in a read-only mode.
- Return type:
bool
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- set_display_area(min_x, min_y, max_x, max_y)[source]¶
Set the area you wish to see.
- Parameters:
min_x (float) – X Min
min_y (float) – Y Min
max_x (float) – X Max
max_y (float) – Y Max
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: The coordinates are based on the current template units (See GetUnits and SetUnits in
GXMAPTEMPLATE
)
- set_drag_drop_enabled(enable)[source]¶
Set whether drag-and-drop is enabled for the map.
- Parameters:
enable (bool) – Enables/disables drag-and-drop
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- set_item_selection(item)[source]¶
Sets the current selected item
- Parameters:
item (str) – item name
New in version 5.0.
License: Geosoft End-User License
Limitations: May not be available while executing a command line program.
Note: An empty string will unselect everything.
- set_template_layout_props(snap_to_grid, snap_dist, view_grid, view_rulers, view_units, grid_red, grid_green, grid_blue)[source]¶
Set the base layout view properties.
- Parameters:
snap_to_grid (bool) – Snap to grid
snap_dist (float) – Snapping distance (always in mm)
view_grid (int) – View Grid
view_rulers (int) – View Rulers
view_units (int) – LAYOUT_VIEW_UNITS constants View Units
grid_red (int) – Grid Red Component (0-255)
grid_green (int) – Grid Green Component (0-255)
grid_blue (int) – Grid Blue Component (0-255)
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This affects the display units and other related properties for the base view of a map.
- set_window_position(left, top, right, bottom, state, is_floating)[source]¶
Get the map window’s position and dock state
- Parameters:
left (int) – Window left position
top (int) – Window top position
right (int) – Window right position
bottom (int) – Window bottom position
state (int) – Window state EMAPTEMPLATE_WINDOW_STATE constants
is_floating (int) – Docked or floating EMAPTEMPLATE_WINDOW_POSITION constants
New in version 9.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- set_window_state(state)[source]¶
Changes the state of the map window
- Parameters:
state (int) – EMAPTEMPLATE_WINDOW_STATE constants
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- track_point(flags, x, y)[source]¶
Get point without prompt or cursor change with tracking
- Parameters:
flags (int) – EMAPTEMPLATE_TRACK constants
x (float_ref) – X coordinate in current view user units.
y (float_ref) – Y
- Returns:
0 if point returned. 1 if user cancelled.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod un_load(name)[source]¶
Unloads a map template.
- Parameters:
name (str) – Name of the map to unload
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: If the map template is not loaded, nothing happens. Same as
un_load_verify
with FALSE to prompt save.
- classmethod un_load_all()[source]¶
Unloads all opened maps
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod un_load_verify(name, prompt)[source]¶
Unloads an edited map, optional prompt to save.
- Parameters:
name (str) – Name of map to unload
prompt (bool) – prompt
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: If the map is not loaded, nothing happens. If “FALSE”, map is saved without a prompt.
- un_lock()[source]¶
This method unlocks the Edited map.
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
EMAPTEMPLATE_PATH constants¶
Four forms
EMAPTEMPLATE_TRACK constants¶
Tracking Options
EMAPTEMPLATE_WINDOW_POSITION constants¶
Window Positioning Options
EMAPTEMPLATE_WINDOW_STATE constants¶
Window State Options