GXEMAP class¶
- class GXEMAP(handle=0)[source]¶
GXEMAP class.
The
GXEMAP
class provides access to a map as displayed within Oasis montaj, but (usually) does not change data within the map itself. It performs functions such as setting the currently displayed area, or drawing “tracking” lines or boxes on the map (which are not part of the map itself).Note:
To obtain access to the map itself, it is recommended practice to begin with an
GXEMAP
object, and use thelock
function to lock the underlying map to prevent external changes. The returnedGXMAP
object (seeGXMAP
) may then be safely used to make changes to the map itself.GXMAP
Redraw Rules:Redraws only occur at the end of the proccess (GX or SCRIPT) not during. You can safely call other GX’s and the map will not redraw. If you need the map to redraw immediately use
redraw
instead.If the final GX calls
GXSYS.cancel_
, the map redraw is not done. If you need to force a redraw when the user hits cancel use theredraw
function.- You can set the redraw flag to
EMAP_REDRAW_YES
orEMAP_REDRAW_NO
at any time using
set_redraw_flag
. This flag will only be looked at, when the last call toun_lock
occurs and is ignored on aGXSYS.cancel_
.
- You can set the redraw flag to
redraw
only works if the current map is not locked. It will do nothing if the map is locked. Issue anun_lock
before using this function.
VIRTUAL
GXEMAP
SUPPORTThese methods are only available when running in an external application. They allow the GX to open a
GXMAP
and then create a VirtualGXEMAP
from that map. The GX can then callmake_current
and set the currentGXEMAP
so that code that follows sees this map as the currentGXMAP
.Supported methods on Virtual EMAPS are:
- activate_group(view_group)[source]¶
Activates a group and associated tools.
- Parameters:
view_group (str) – “View/Group”
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Activating a group basically enters the edit mode associated with the type of group. E.g. a vector group will enable the edit toolbar for that gorup and an
GXAGG
will bring up the image color tool. Be sure to pass a combined name containing both the view name and the group separated by a “/” or “".
- activate_view(view)[source]¶
Activates a view and associated tools.
- Parameters:
view (str) – “View”
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- change_current_view(view)[source]¶
Change the current working view.
- Parameters:
view (str) – View name
- Returns:
0 if view set, 1 if view does not exist.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This function operates on the current map. Unlike
set_current_view
this function’s action survive the GX finishing.
- copy_to_clip()[source]¶
Copy entire map to clipboard.
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Four objects are placed on the clipboard:
Georefernce Text
Bitmap of current window screen resolution
EMF of current window screen resolution
Entire map as a Geosoft View (go to view mode and hit paste). The coordinates are placed in the current view coordinates.
- create_group_snapshot(lst)[source]¶
Loads an
GXLST
with the current view/group names existing in a map. Typically used to track group changes that are about to occur.- Parameters:
- Returns:
0 if
GXLST
filled properly 1 if not- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod create_virtual(name)[source]¶
Makes this
GXEMAP
object the current active object to the user.- Parameters:
name (str) – Name of map to create a virtual
GXEMAP
from- Returns:
GXEMAP
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.
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:
GXEMAP
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.
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.
- destroy_view(unload_flag)[source]¶
Removes the view from the workspace.
- Parameters:
unload_flag (int) – EMAP_REMOVE constants
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Can only be run in interactive mode. After this call the
GXEMAP
object will become invalid. If this is the last view on the document and the document has been modified the map will be unloaded and optionally saved depending on the EMAP_REMOVE constants parameter.
- digitize(wa, img, digits, prompt, prefix, delim, newline)[source]¶
Digitise points from the current map and place in a
GXWA
.- Parameters:
digits (int) – Number of significant digits to use, 0 for all.
prompt (str) – Command line prompt string
prefix (str) – New line prefix string
delim (str) – Delimiter
newline (int) – 0 for no newline 1 for automatic newline at each point
- Returns:
0 if user digitized some points. 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 command line will start to recieve digitized points from the mouse. Whenever the left mouse button is pressed, the current view X,Y are placed on the workspace command line. If a valid
GXIMG
is passed, the Z value is also placed on the command line. If auto-newline is specified, the line is immediately placed intoGXWA
, otherwise the user has the oportunity to enter data before pressing Enter.Locations are in the current view user units
- digitize2(vvx, vvy, vvz, img, prompt, newline)[source]¶
Digitise points from the current map and place in VVs.
- Parameters:
- Returns:
0 if user digitized some points. 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 command line will start to recieve digitized points from the mouse. Whenever the left mouse button is pressed, the current view X,Y are placed on the workspace command line. If a valid
GXIMG
is passed, the Z value is also placed on the command line. If auto-newline is specified, the line is immediately placed into the VVs, otherwise the user has the oportunity to enter data before pressing Enter.Locations are in the current view user units
- digitize_peaks(vvx, vvy, vvz, img, prompt, newline)[source]¶
Digitise points from the current map and place in VVs.
- Parameters:
- Returns:
0 if user digitized some points. 1 if user cancelled.
- Return type:
int
New in version 9.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Same as
digitize2
, but the closest peaks to the selected locations are returned instead of the selected location. The method chooses the highest value of the 8 surrounding points, the repeats this process until no higher value can be found in any of the 8 surrounding points. If there are two or more points with a higher value, it will just take the first one and continue, and this method will stall on flat areas as well (since no surrounding point is larger).
- digitize_polygon(vvx, vvy, vvz, img, prompt, newline, pixel_radius)[source]¶
Same as iDigitze2_EMAP, but automatically close polygons.
- Parameters:
prompt (str) – Command line prompt string
newline (int) – 0 for no newline 1 for automatic newline at each point
pixel_radius (int) – Close the polygon if the selected location is within this radius in screen pixels.
- Returns:
0 if user digitized some points. 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: This is the same as
digitize2
, except that it automatically detects, (except for the 2nd and 3rd points) when a selected location is within the entered number of pixels from the starting point. If yes, the polygon is assumed to be closed, and the operation is the same as the RMB “done” command, and the process returns 0.
- doubleize_group_snapshot(state)[source]¶
The
GXLST
passed in must contain ViewGroup strings in the Name field only. The function will compare with a more currentGXLST
and zoom the map to the new entry.- Parameters:
- Returns:
0 if zoom proceeded ok 1 if error
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Typically this function is used in conjunction with CreateSnapshot_EMAP.
- drag_drop_enabled()[source]¶
Checks if drag-and-drop 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.
- draw_line(min_x, min_y, max_x, max_y)[source]¶
Draws a line on the current map.
- Parameters:
min_x (float) – X1
min_y (float) – Y1
max_x (float) – X2
max_y (float) – Y2
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Locations are in the current view user units.
The line is temporary and will disappear on the next screen refresh. This function is for you to provide interactive screen feedback to your user.
- draw_ply(polygon)[source]¶
Draws a polygon on the current map.
New in version 9.6.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Locations are in the current view user units.
The polygon is temporary and will disappear on the next screen refresh. This function is for you to provide interactive screen feedback to your user.
- draw_rect(min_x, min_y, max_x, max_y)[source]¶
Draws a rect on the current map.
- Parameters:
min_x (float) – X1
min_y (float) – Y1
max_x (float) – X2
max_y (float) – Y2
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Locations are in the current view user units.
The line is temporary and will disappear on the next screen refresh. This function is for you to provide interactive screen feedback to your user.
- draw_rect_3d(x, y, z, pix)[source]¶
Plot a square symbol on a section view.
- Parameters:
x (float) – X - True X location
y (float) – Y - True Y location
z (float) – Z - True Z location
pix (int) – Size in pixels (“radius”)
New in version 9.1.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Plot a square symbol on a section view, but input 3D user coordinates
The line is temporary and will disappear on the next screen refresh. This function is for you to provide interactive screen feedback to your user.
- drop_map_clip_data(hglobal)[source]¶
Drop Map clipboard data on this
GXEMAP
- Parameters:
hglobal (int) – Handle to Global Clipboard data
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- font_lst(lst, which)[source]¶
List all Windows and geosoft fonts.
- Parameters:
lst (GXLST) – List Object
which (int) – EMAP_FONT constants
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: To get TT and GFN fonts, call twice with the same list and
EMAP_FONT_TT
, thenEMAP_FONT_GFN
, or vice-versa to change order of listing.
- get_3d_view_name(name)[source]¶
Get the name of a 3D view if the current view is 3D.
- 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_aoi_area(min_x, min_y, max_x, max_y)[source]¶
Get the area of interest.
- Parameters:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Coordinates are based on the current view units.
- get_box(str_val, 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.
- get_box2(str_val, x1, y1, x2, y2, x3, y3, x4, y4)[source]¶
Returns the coordinates of a user selected box in a warped view.
- 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: If the data view has a rotational (or other) warp, then the
get_box
function returns only opposite diagonal points in the box, not enough info to determine the other two corners. This function returns the exact coordinates of all four corners, calculated from the pixel locations.
- get_cur_point(x, y)[source]¶
Returns the coordinates of the currently selected point in view coordinates
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- get_cur_point_mm(x, y)[source]¶
Returns the coordinates of the currently selected point in mm on map
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- get_current_group(group)[source]¶
Get the current group name.
- Parameters:
group (str_ref) – Returned group name
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This function operates on the current map.
- get_current_view(view)[source]¶
Get the current view name.
- Parameters:
view (str_ref) – Returned view name
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This function operates on the current map.
- get_cursor(x, y)[source]¶
Returns the coordinates of the last known cursor location
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- get_cursor_mm(x, y)[source]¶
Returns the coordinates of the last known cursor location in mm on map.
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- 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: Coordinates are based on the current view units. For 3D views this will return the full map extents.
- get_display_area_raw(min_x, min_y, max_x, max_y)[source]¶
Get the area you are currently looking at in raw map units
- Parameters:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Coordinates are in millimeters. For 3D views this will return the full map extents.
- get_e_3dv()[source]¶
-
New in version 9.3.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- get_grid(str_val, nx, ny, angle, x1, y1, x_len, y_len)[source]¶
Position and size a grid on a map.
- Parameters:
str_val (str) – User prompt string
nx (int) – Number of elements along primary axis to draw.
ny (int) – Number of elements along secondary axis to draw.
angle (float_ref) – Angle of primary axis in degrees
x1 (float_ref) – Grid origin X
y1 (float_ref) – Grid origin Y
x_len (float_ref) – Primary axis length
y_len (float_ref) – Secondary axis length
- 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: If the input angle is
rDUMMY
, an extra step is inserted for the user to define the angle by drawing a line with the mouse. The output primary axis angle will always be in the range -90 < angle <= 90. The grid origin is shifted to whichever corner necessary to make this possible, while keeping the secondary axis at 90 degrees greater than the primary ( going counter-clockwise). The coordinates are returned in the current User projection (SeeGXMVIEW.get_user_ipj
andGXMVIEW.set_user_ipj
.)
- 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 User projection (See
GXMVIEW.get_user_ipj
andGXMVIEW.set_user_ipj
.)
- get_line_ex(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 - Right Mouse 2 - Escape/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 coordinates are returned in the current User projection (See
GXMVIEW.get_user_ipj
andGXMVIEW.set_user_ipj
.)
- get_line_xyz(str_val, min_x, min_y, min_z, max_x, max_y, max_z)[source]¶
Returns the end points of a line in X,Y and Z
- Parameters:
- Returns:
0 if line returned. 1 - Right Mouse 2 - Escape/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 coordinates are returned in the current User projection (See
GXMVIEW.get_user_ipj
andGXMVIEW.set_user_ipj
.) This is useful for digitizing a line in an oriented view and getting the true coordinates in (X, Y, Z) at the selected point on the view plane.
- get_map_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_map_snap(snap)[source]¶
Get current snapping distance in MM
- Parameters:
snap (float_ref) – Snap value in MM (returned)
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- classmethod get_maps_lst(lst, path)[source]¶
Load the file names of open maps into a
GXLST
.- Parameters:
path (int) – EMAP_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
GXEMAP
.- 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: This will wait for user to select a point.
See also
iTrackPoint, GetCurPoint, GetCursor
- get_point_3d(str_val, x, y, z)[source]¶
Returns the coordinates of a user selected point.
- Parameters:
- Returns:
0 if point returned. 1 if user used right mouse and then Done. 2 if user cancelled. 3 if capture is lost.
- Return type:
int
New in version 9.1.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This will wait for user to select a point.
See also
iTrackPoint, GetCurPoint, GetCursor
- get_point_ex(str_val, x, y)[source]¶
Returns the coordinates of a user selected point.
- Parameters:
- Returns:
0 if point returned. 1 if user used right mouse and then Done. 2 if user cancelled. 3 if capture is lost.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This will wait for user to select a point.
See also
iTrackPoint, GetCurPoint, GetCursor
- get_poly_line(str_val, vv_x, vv_y)[source]¶
Returns a polyline.
- 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 User projection (See
GXMVIEW.get_user_ipj
andGXMVIEW.set_user_ipj
.)
- get_poly_line_xyz(str_val, vv_x, vv_y, vv_z)[source]¶
Returns a polyline.
- 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 User projection (See
GXMVIEW.get_user_ipj
andGXMVIEW.set_user_ipj
.) In this version of the method X, Y and Z (depth) are returned. Initially created to deal with crooked sections.
- 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 User projection (See
GXMVIEW.get_user_ipj
andGXMVIEW.set_user_ipj
.) If the userGXIPJ
distorts the coordinates from being rectilinear (e.g. for a TriPlot graph), then care should be taken since the (Xmin, Ymin) and (Xmax, Ymax) values returned do not necessarily correspond to the lower-left and upper-right corners. In fact, the returned values are calculated by taking the starting (fixed) corner and the tracked (opposite) corner, and finding the min and max for X and Y among these two points. With a warped User projection, those two corner locations could easily be (Xmin, Ymax) and (Xmax, Ymin). This becomes quite important if you want to use the rectangle for a masking operation, because the “other” two corner’s coordinates may need to be constructed based on a knowledge of the User projection, and may not be directly obtained from the returned X and Y min and max values. What appears to be a rectangle as seen on the map is not necessarily a rectangle in the User coordinates.
- get_selected_vertices(vv_x, vv_y)[source]¶
Get the verticies of selected object
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Works only in Vertex Edit Mode
- get_view_ipj(view, ipj)[source]¶
Get a view’s
GXIPJ
.New in version 9.1.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This function can be used to obtain a views coordinate system without having to call
lock
. This could be an expensive operation that cause undesirable UX.
- 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 EMAP_WINDOW_STATE constants
is_floating (int_ref) – Docked or floating EMAP_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_3d_view()[source]¶
Is the current view a 3D view.
- Returns:
1 - Yes, 0 - No
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- is_grid()[source]¶
Is the map a grid map?
- Returns:
1 - Yes, 0 - No
- 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]¶
Checks if map is 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:
GXEMAP
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_control(map_file, window)[source]¶
Version of
load
that can be used to load a database via subclassing into a Windows control.- Parameters:
map_file (str) – Map filename
window (int) – Window handle to receive document
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- 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 load_with_view(name, p2)[source]¶
Load an
GXEMAP
with the view from a currentGXEMAP
.- Parameters:
- Returns:
New
GXEMAP
handle.- Return type:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Can only be run in interactive mode. Is used by dbsubset to create a new database with the same view as previously.
- classmethod load_with_view_control(map_file, emap, window)[source]¶
Version of
GXEDB.load_with_view
that can be used to load a database via subclassing into a Windows control.- Parameters:
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- 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.
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: The Redraw flag is set to
EMAP_REDRAW_YES
when this functions is called.
- make_current()[source]¶
Makes this
GXEMAP
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.
- packed_files()[source]¶
The number of packed files in the map.
- Returns:
The number of packed files in map.
- Return type:
int
New in version 9.2.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- print_(entire_map, scale_to_fit, print_to_file, all_pages, centre, copies, first_page, last_page, scale_factor, overlap_size, offset_x, offset_y, file)[source]¶
Print the current map to current printer.
- Parameters:
entire_map (int) – lEntireMap (0 or 1)
scale_to_fit (int) – lScaleToFit 0 - use scale factor 1 - fit to media 2 - fit to roll media
print_to_file (int) – lPrintToFile(0 or 1)
all_pages (int) – lAllPages (0 or 1)
centre (int) – lCentre (0 or 1)
copies (int) – lCopies
first_page (int) – lFirstPage
last_page (int) – lLastPage
scale_factor (float) – dScaleFactor (2.0 doubles plot size)
overlap_size (int) – lOverlapSize (mm)
offset_x (int) – lOffsetX (mm)
offset_y (int) – lOffsetY (mm)
file (str) – szFile (if lPrintToFile==1)
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- 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.
- redraw()[source]¶
Redraw the map immediately.
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Redraws the map immediately. Map must not be locked.
- classmethod reload_grid(name)[source]¶
Reloads a grid document.
- Parameters:
name (str) – Source file name
New in version 9.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: Use this method to reload (if loaded) a grid document if the file on disk changed.
- select_group(view_group)[source]¶
Select a group.
- Parameters:
view_group (str) – “View/Group”
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- set_aoi_area(min_x, min_y, max_x, max_y)[source]¶
Set the area of interest.
- 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: Coordinates are based on the current view user units. The map is immediatly redrawn.
- set_current_view(view)[source]¶
Set the current working view.
- Parameters:
view (str) – View name
- Returns:
0 if view set, 1 if view does not exist.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This function operates on the current map. It changes the view only during the execution of the GX. As soon as the GX terminates the view will revert to the original one.
- 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: Coordinates are based on the current view user units. The map is immediatly redrawn.
- 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_map_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_map_snap(snap)[source]¶
Set current snapping distance in MM
- Parameters:
snap (float) – Snap value in MM
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
- set_redraw_flag(redraw)[source]¶
Set the redraw flag.
- Parameters:
redraw (int) – EMAP_REDRAW constants
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This function is generally used to prevent redrawing of the map, which normally occurs after the last
un_lock
call, in cases where it is known that no changes are being made to the map.Typical usage would be to call
lock
followed byset_redraw_flag
(withEMAP_REDRAW_NO
) prior to querying information from the map. And then end with a call toun_lock
.
- set_viewport_mode(mode)[source]¶
Set the viewport mode.
- Parameters:
mode (int) – EMAP_VIEWPORT constants
New in version 5.0.
License: Geosoft Open License
Limitations: May not be available while executing a command line program.
Note: This is handy for using a map to define an area of interest. Use in conjunction with Get/Set AOIArea. If this is used inside montaj it is important to set or provide for a method to set the map mode back to normal as this is not exposed in the interface.
- 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 EMAP_WINDOW_STATE constants
is_floating (int) – Docked or floating EMAP_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) – EMAP_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) – EMAP_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
GXMAP
.- 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
GXMAP
is not loaded, nothing happens. Same asun_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.
EMAP_FONT constants¶
Font Types
EMAP_PATH constants¶
Four forms
EMAP_REDRAW constants¶
Redraw Options
EMAP_REMOVE constants¶
How to handle pending changes in document
EMAP_TRACK constants¶
Tracking Options
EMAP_VIEWPORT constants¶
Tracking Options
EMAP_WINDOW_POSITION constants¶
Window Positioning Options
EMAP_WINDOW_STATE constants¶
Window State Options
LAYOUT_VIEW_UNITS constants¶
Base dlayout display units