GXEMAP class

class GXEMAP(handle=0)

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 the lock function to lock the underlying map to prevent external changes. The returned GXMAP object (see GXMAP) may then be safely used to make changes to the map itself.

GXMAP Redraw Rules:

  1. 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.
  2. 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 the redraw function.
  3. You can set the redraw flag to EMAP_REDRAW_YES or EMAP_REDRAW_NO at any
    time using set_redraw_flag. This flag will only be looked at, when the last call to un_lock occurs and is ignored on a GXSYS.cancel_.
  4. redraw only works if the current map is not locked. It will do nothing if the map is locked. Issue an un_lock before using this function.

VIRTUAL GXEMAP SUPPORT

These methods are only available when running in an external application. They allow the GX to open a GXMAP and then create a Virtual GXEMAP from that map. The GX can then call make_current and set the current GXEMAP so that code that follows sees this map as the current GXMAP.

Supported methods on Virtual EMAPS are:

activate_group(view_group)

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)

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)

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()

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:

  1. Georefernce Text
  2. Bitmap of current window screen resolution
  3. EMF of current window screen resolution
  4. 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)

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:lst (GXLST) – GXLST object to fill
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)

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:GXEMAP

New in version 5.0.

License: Geosoft Open License

Limitations: May not be available while executing a command line program.

classmethod current()

This method returns the Current Edited map.

Returns:GXEMAP Object
Return type:GXEMAP

New in version 5.0.

License: Geosoft Open License

Limitations: May not be available while executing a command line program.

classmethod current_if_exists()

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:GXEMAP

New in version 5.0.

License: Geosoft Open License

Limitations: May not be available while executing a command line program.

classmethod current_no_activate()

This method returns the Current Edited map.

Returns:GXEMAP Object
Return type:GXEMAP

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)

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)

Digitise points from the current map and place in a GXWA.

Parameters:
  • wa (GXWA) – GXWA in which to write digitized points
  • img (GXIMG) – GXIMG for Z value, or IMG_NULL for no Z.
  • 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 into GXWA, 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)

Digitise points from the current map and place in VVs.

Parameters:
  • vvx (GXVV) – Real X GXVV
  • vvy (GXVV) – Real Y GXVV
  • vvz (GXVV) – Real Z GXVV
  • img (GXIMG) – GXIMG for Z value, or IMG_NULL for no Z.
  • prompt (str) – Command line prompt string
  • 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 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)

Digitise points from the current map and place in VVs.

Parameters:
  • vvx (GXVV) – Real X GXVV
  • vvy (GXVV) – Real Y GXVV
  • vvz (GXVV) – Real Z GXVV
  • img (GXIMG) – GXIMG for Z value, or IMG_NULL for no Z.
  • prompt (str) – Command line prompt string
  • 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 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)

Same as iDigitze2_EMAP, but automatically close polygons.

Parameters:
  • vvx (GXVV) – Real X GXVV
  • vvy (GXVV) – Real Y GXVV
  • vvz (GXVV) – Real Z GXVV
  • img (GXIMG) – GXIMG for Z value, or IMG_NULL for no Z.
  • 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)

The GXLST passed in must contain ViewGroup strings in the Name field only. The function will compare with a more current GXLST and zoom the map to the new entry.

Parameters:state (GXLST) – GXLST object used for comparison
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()

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)

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_rect(min_x, min_y, max_x, max_y)

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)

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)

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)

List all Windows and geosoft fonts.

Parameters:

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, then EMAP_FONT_GFN, or vice-versa to change order of listing.

get_3d_view_name(name)

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)

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)

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)

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)

Returns the coordinates of the currently selected point in view coordinates

Parameters:

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)

Returns the coordinates of the currently selected point in mm on map

Parameters:

New in version 5.0.

License: Geosoft Open License

Limitations: May not be available while executing a command line program.

get_current_group(group)

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)

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)

Returns the coordinates of the last known cursor location

Parameters:

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)

Returns the coordinates of the last known cursor location in mm on map.

Parameters:

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)

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)

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()

Get an GXE3DV from the GXEMAP

Returns:GXE3DV object
Return type:GXE3DV

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)

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 (See GXMVIEW.get_user_ipj and GXMVIEW.set_user_ipj.)

get_line(str_val, min_x, min_y, max_x, max_y)

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 and GXMVIEW.set_user_ipj.)

get_line_ex(str_val, min_x, min_y, max_x, max_y)

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 and GXMVIEW.set_user_ipj.)

get_line_xyz(str_val, min_x, min_y, min_z, max_x, max_y, max_z)

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 and GXMVIEW.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)

Get the base layout view properties.

Parameters:

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)

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)

Load the file names of open maps into a GXLST.

Parameters:
Returns:

The number of documents loaded into the GXLST. The GXLST 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)

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)

Returns the coordinates of a user selected point.

Parameters:
  • str_val (str) – User prompt string
  • 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.

Note: This will wait for user to select a point.

See also

iTrackPoint, GetCurPoint, GetCursor

get_point_3d(str_val, x, y, z)

Returns the coordinates of a user selected point.

Parameters:
  • str_val (str) – User prompt string
  • x (float_ref) – X coordinate in current view user units.
  • y (float_ref) – Y
  • z (float_ref) – Z
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)

Returns the coordinates of a user selected point.

Parameters:
  • str_val (str) – User prompt string
  • x (float_ref) – X coordinate in current view user units.
  • y (float_ref) – Y
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)

Returns a polyline.

Parameters:
  • str_val (str) – User prompt string
  • vv_x (GXVV) – X
  • vv_y (GXVV) – Y
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 and GXMVIEW.set_user_ipj.)

get_poly_line_xyz(str_val, vv_x, vv_y, vv_z)

Returns a polyline.

Parameters:
  • str_val (str) – User prompt string
  • vv_x (GXVV) – X
  • vv_y (GXVV) – Y
  • vv_z (GXVV) – Z
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 and GXMVIEW.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)

Returns the coordinates of a user selected box starting at a corner.

Parameters:
  • str_val (str) – User prompt string
  • min_x (float_ref) – X minimum in current view user units. (defines corner)
  • min_y (float_ref) – Y
  • max_x (float_ref) – X maximum
  • max_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.

Note: The coordinates are returned in the current User projection (See GXMVIEW.get_user_ipj and GXMVIEW.set_user_ipj.) If the user GXIPJ 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)

Get the verticies of selected object

Parameters:

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)

Get a view’s GXIPJ.

Parameters:
  • view (str) – View name
  • ipj (GXIPJ) – GXIPJ in which to place the view 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)

Get the map window’s position and dock state

Parameters:

New in version 9.0.

License: Geosoft Open License

Limitations: May not be available while executing a command line program.

get_window_state()

Retrieve the current state of the map window

Returns:EMAP_WINDOW_STATE constants
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()

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)

Find a loaded map that has a setting in its reg.

Parameters:
  • field (str) – GXREG field name
  • value (str) – GXREG field value to find
  • name (str_ref) – Buffer for map name
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()

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()

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()

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()

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)

Loads maps into the editor.

Parameters:name (str) – List of maps (‘;’ or ‘|’ delimited) to load.
Returns:GXEMAP Object to edited map.
Return type:GXEMAP

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)

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)

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:GXEMAP

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)

Load an GXEMAP with the view from a current GXEMAP.

Parameters:
  • name (str) – Source Map name
  • p2 (GXEMAP) – GXEMAP to use as the source view
Returns:

New GXEMAP handle.

Return type:

GXEMAP

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)

Version of GXEDB.load_with_view that can be used to load a database via subclassing into a Windows control.

Parameters:
  • map_file (str) – Map filename
  • emap (GXEMAP) – GXEMAP handle to use as the source view
  • 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 loaded(name)

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()

This method locks the Edited map.

Returns:GXEMAP Object to map associated with edited map.
Return type:GXMAP

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()

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.

classmethod null()

A null (undefined) instance of GXEMAP

Returns:A null GXEMAP
Return type:GXEMAP
packed_files()

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)

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()

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()

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)

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)

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)

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)

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)

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)

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)

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)

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)

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 by set_redraw_flag (with def_val:EMAP_REDRAW_NO) prior to querying information from the map. And then end with a call to un_lock.

set_viewport_mode(mode)

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)

Get the map window’s position and dock state

Parameters:

New in version 9.0.

License: Geosoft Open License

Limitations: May not be available while executing a command line program.

set_window_state(state)

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)

Get point without prompt or cursor change with tracking

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.

classmethod un_load(name)

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 as un_load_verify with FALSE to prompt save.

classmethod un_load_all()

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)

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()

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_FONT_TT

Tt

gxapi.EMAP_FONT_TT = 0
EMAP_FONT_GFN

Gfn

gxapi.EMAP_FONT_GFN = 1

EMAP_PATH constants

Four forms

EMAP_PATH_FULL

d:\directory\file.gdb

gxapi.EMAP_PATH_FULL = 0
EMAP_PATH_DIR

\directory\file.gdb

gxapi.EMAP_PATH_DIR = 1
EMAP_PATH_NAME_EXT

File.gdb

gxapi.EMAP_PATH_NAME_EXT = 2
EMAP_PATH_NAME

File

gxapi.EMAP_PATH_NAME = 3

EMAP_REDRAW constants

Redraw Options

EMAP_REDRAW_NO

No

gxapi.EMAP_REDRAW_NO = 0
EMAP_REDRAW_YES

Yes

gxapi.EMAP_REDRAW_YES = 1

EMAP_REMOVE constants

How to handle pending changes in document

EMAP_REMOVE_SAVE

Save

gxapi.EMAP_REMOVE_SAVE = 0
EMAP_REMOVE_PROMPT

Prompt

gxapi.EMAP_REMOVE_PROMPT = 1
EMAP_REMOVE_DISCARD

Discard

gxapi.EMAP_REMOVE_DISCARD = 2

EMAP_TRACK constants

Tracking Options

EMAP_TRACK_ERASE

Erase Object after you return?

gxapi.EMAP_TRACK_ERASE = 1
EMAP_TRACK_RMENU

Allow use of right-menu

gxapi.EMAP_TRACK_RMENU = 2
EMAP_TRACK_CYCLE

If user holds down left-mouse, will return many times

gxapi.EMAP_TRACK_CYCLE = 4

EMAP_VIEWPORT constants

Tracking Options

EMAP_VIEWPORT_NORMAL

Normal map usage

gxapi.EMAP_VIEWPORT_NORMAL = 0
EMAP_VIEWPORT_BROWSEZOOM

Zoom Mode

gxapi.EMAP_VIEWPORT_BROWSEZOOM = 1
EMAP_VIEWPORT_BROWSEAOI

Change Area Of Interest Mode

gxapi.EMAP_VIEWPORT_BROWSEAOI = 2

EMAP_WINDOW_POSITION constants

Window Positioning Options

EMAP_WINDOW_POSITION_DOCKED

Docked

gxapi.EMAP_WINDOW_POSITION_DOCKED = 0
EMAP_WINDOW_POSITION_FLOATING

Floating

gxapi.EMAP_WINDOW_POSITION_FLOATING = 1

EMAP_WINDOW_STATE constants

Window State Options

EMAP_WINDOW_RESTORE

Emap window restore

gxapi.EMAP_WINDOW_RESTORE = 0
EMAP_WINDOW_MINIMIZE

Emap window minimize

gxapi.EMAP_WINDOW_MINIMIZE = 1
EMAP_WINDOW_MAXIMIZE

Emap window maximize

gxapi.EMAP_WINDOW_MAXIMIZE = 2

LAYOUT_VIEW_UNITS constants

Base dlayout display units

LAYOUT_VIEW_MM

Millimeters

gxapi.LAYOUT_VIEW_MM = 0
LAYOUT_VIEW_CM

Centimeters

gxapi.LAYOUT_VIEW_CM = 1
LAYOUT_VIEW_IN

Inches

gxapi.LAYOUT_VIEW_IN = 2