GXEMAP class¶
-
class
geosoft.gxapi.
GXEMAP
¶ The EMAP 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 EMAP object, and use the
geosoft.gxapi.GXEMAP.lock()
function to lock the underlying map to prevent external changes. The returned MAP object (see MAP.GXH) may then be safely used to make changes to the map itself. MAP 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 usegeosoft.gxapi.GXEMAP.redraw()
instead. 2. If the final GX callsgeosoft.gxapi.GXSYS.cancel()
, the map redraw is not done. If you need to force a redraw when the user hits cancel use thegeosoft.gxapi.GXEMAP.redraw()
function. 3. You can set the redraw flag to EMAP_REDRAW_YES or EMAP_REDRAW_NO at any time usinggeosoft.gxapi.GXEMAP.set_redraw_flag()
. This flag will only be looked at, when the last call togeosoft.gxapi.GXEMAP.un_lock()
occurs and is ignored on ageosoft.gxapi.GXSYS.cancel()
. 4.geosoft.gxapi.GXEMAP.redraw()
only works if the current map is not locked. It will do nothing if the map is locked. Issue angeosoft.gxapi.GXEMAP.un_lock()
before using this function. VIRTUAL EMAP SUPPORT These methods are only available when running in an external application. They allow the GX to open a MAP and then create a Virtual EMAP from that map. The GX can then callgeosoft.gxapi.GXEMAP.make_current()
and set the current EMAP so that code that follows sees this map as the current MAP. Supported methods on Virtual EMAPS are:geosoft.gxapi.GXEMAP.current()
geosoft.gxapi.GXEMAP.current_no_activate()
geosoft.gxapi.GXEMAP.make_current()
geosoft.gxapi.GXEMAP.have_current()
geosoft.gxapi.GXEMAP.current_if_exists()
geosoft.gxapi.GXMAP.current()
geosoft.gxapi.GXEMAP.lock()
geosoft.gxapi.GXEMAP.un_lock()
geosoft.gxapi.GXEMAP.is_locked()
geosoft.gxapi.GXEMAP.get_name()
geosoft.gxapi.GXEMAP.set_redraw_flag()
geosoft.gxapi.GXEMAP.redraw()
geosoft.gxapi.GXEMAP.loaded()
geosoft.gxapi.GXEMAP.load()
geosoft.gxapi.GXEMAP.load_no_activate()
geosoft.gxapi.GXEMAP.un_load_verify()
geosoft.gxapi.GXEMAP.un_load()
geosoft.gxapi.GXEMAP.create_virtual()
-
activate_group
((str)arg1) → None:¶ Activates a group and associated tools.
Parameters: arg1 (str) – “View/Group” Returns: Nothing Return type: None New in version 5.0.0.
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 AGG will bring up the image colour tool. Be sure to pass a combined name containing both the view name and the group separated by a "/" or "".
-
activate_view
((str)arg1) → None:¶ Activates a view and associated tools.
Parameters: arg1 (str) – “View” Returns: Nothing Return type: None New in version 5.0.0.
-
change_current_view
((str)arg1) → int:¶ Change the current working view.
Parameters: arg1 (str) – view name Returns: 0 if view set, 1 if view does not exist. Return type: int New in version 5.0.0.
Note:
This function operates on the current map. Unlike
geosoft.gxapi.GXEMAP.set_current_view()
this function's action survive the GX finishing.
-
copy_to_clip
() → None:¶ Copy entire map to clipboard.
Returns: Nothing Return type: None New in version 5.0.0.
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
((GXLST)arg1) → int:¶ Loads an LST with the current view/group names existing in a map. Typically used to track group changes that are about to occur.
Parameters: arg1 ( geosoft.gxapi.GXLST
) – LST object to fillReturns: 0 if LST filled properly 1 if not Return type: int New in version 5.0.0.
-
static
create_virtual
((str)arg1) → GXEMAP:¶ Makes this EMAP object the current active object to the user.
Parameters: arg1 (str) – Name of map to create a virtual EMAP from Returns: EMAP Object Return type: geosoft.gxapi.GXEMAP
New in version 5.0.0.
-
static
current
() → GXEMAP:¶ This method returns the Current Edited map.
Returns: EMAP Object Return type: geosoft.gxapi.GXEMAP
New in version 5.0.0.
-
static
current_if_exists
() → GXEMAP:¶ This method returns the Current Edited map.
Returns: EMAP 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: geosoft.gxapi.GXEMAP
New in version 5.0.0.
-
static
current_no_activate
() → GXEMAP:¶ This method returns the Current Edited map.
Returns: EMAP Object Return type: geosoft.gxapi.GXEMAP
New in version 9.0.0.
Note:
This function acts just like
geosoft.gxapi.GXEMAP.current()
except that the document is not activated (brought to foreground) and no guarantee is given about which document is currently active.
-
destroy_view
((int)arg1) → None:¶ Removes the view from the workspace.
Parameters: arg1 (int) – EMAP_REMOVE constants Returns: Nothing Return type: None New in version 5.0.0.
Note:
Can only be run in interactive mode. After this call the EMAP 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
((GXWA)arg1, (GXIMG)arg2, (int)arg3, (str)arg4, (str)arg5, (str)arg6, (int)arg7) → int:¶ Digitise points from the current map and place in a WA.
Parameters: - arg1 (
geosoft.gxapi.GXWA
) – WA in which to write digitized points - arg2 (
geosoft.gxapi.GXIMG
) – IMG for Z value, or IMG_NULL for no Z. - arg3 (int) – number of significant digits to use, 0 for all.
- arg4 (str) – Command line prompt string
- arg5 (str) – New line prefix string
- arg6 (str) – Delimiter
- arg7 (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.0.
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 IMG is passed, the Z value is also placed on the command line. If auto-newline is specified, the line is immediately placed into WA, otherwise the user has the oportunity to enter data before pressing Enter. Locations are in the current view user units
- arg1 (
-
digitize2
((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXIMG)arg4, (str)arg5, (int)arg6) → int:¶ Digitise points from the current map and place in VVs.
Parameters: - arg1 (
geosoft.gxapi.GXVV
) – real X VV - arg2 (
geosoft.gxapi.GXVV
) – real Y VV - arg3 (
geosoft.gxapi.GXVV
) – real Z VV - arg4 (
geosoft.gxapi.GXIMG
) – IMG for Z value, or IMG_NULL for no Z. - arg5 (str) – Command line prompt string
- arg6 (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.0.
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 IMG 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
- arg1 (
-
digitize_peaks
((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXIMG)arg4, (str)arg5, (int)arg6) → int:¶ Digitise points from the current map and place in VVs.
Parameters: - arg1 (
geosoft.gxapi.GXVV
) – real X VV - arg2 (
geosoft.gxapi.GXVV
) – real Y VV - arg3 (
geosoft.gxapi.GXVV
) – real Z VV - arg4 (
geosoft.gxapi.GXIMG
) – IMG for Z value, or IMG_NULL for no Z. - arg5 (str) – Command line prompt string
- arg6 (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.0.
Note:
Same as
geosoft.gxapi.GXEMAP.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).- arg1 (
-
digitize_polygon
((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXIMG)arg4, (str)arg5, (int)arg6, (int)arg7) → int:¶ Same as iDigitze2_EMAP, but automatically close polygons.
Parameters: - arg1 (
geosoft.gxapi.GXVV
) – real X VV - arg2 (
geosoft.gxapi.GXVV
) – real Y VV - arg3 (
geosoft.gxapi.GXVV
) – real Z VV - arg4 (
geosoft.gxapi.GXIMG
) – IMG for Z value, or IMG_NULL for no Z. - arg5 (str) – Command line prompt string
- arg6 (int) – 0 for no newline 1 for automatic newline at each point
- arg7 (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.0.
Note:
This is the same as
geosoft.gxapi.GXEMAP.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.- arg1 (
-
doubleize_group_snapshot
((GXLST)arg1) → int:¶ The LST passed in must contain ViewGroup strings in the Name field only. The function will compare with a more current LST and zoom the map to the new entry.
Parameters: arg1 ( geosoft.gxapi.GXLST
) – LST object used for comparisonReturns: 0 if zoom proceeded ok 1 if error Return type: int New in version 5.0.0.
Note:
Typically this function is used in conjunction with CreateSnapshot_EMAP.
-
drag_drop_enabled
() → bool:¶ Is drag-and-drop enabled for the map?
Returns: bool Return type: bool New in version 5.0.0.
-
draw_line
((float)arg1, (float)arg2, (float)arg3, (float)arg4) → None:¶ Draws a line on the current map.
Parameters: - arg1 (float) – X1
- arg2 (float) – Y1
- arg3 (float) – X2
- arg4 (float) – Y2
Returns: Nothing
Return type: None
New in version 5.0.0.
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
((float)arg1, (float)arg2, (float)arg3, (float)arg4) → None:¶ Draws a rect on the current map.
Parameters: - arg1 (float) – X1
- arg2 (float) – Y1
- arg3 (float) – X2
- arg4 (float) – Y2
Returns: Nothing
Return type: None
New in version 5.0.0.
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
((float)arg1, (float)arg2, (float)arg3, (int)arg4) → None:¶ Plot a square symbol on a section view.
Parameters: - arg1 (float) – X - True X location
- arg2 (float) – Y - True Y location
- arg3 (float) – Z - True Z location
- arg4 (int) – Size in pixels (“radius”)
Returns: Nothing
Return type: None
New in version 9.1.0.
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
((int)arg1) → None:¶ Drop Map clipboard data on this EMAP
Parameters: arg1 (int) – Handle to Global Clipboard data Returns: Nothing Return type: None New in version 5.0.0.
-
font_lst
((GXLST)arg1, (int)arg2) → None:¶ List all Windows and geosoft fonts.
Parameters: - arg1 (
geosoft.gxapi.GXLST
) – List Object - arg2 (int) – EMAP_FONT constants
Returns: Nothing
Return type: None
New in version 5.0.0.
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.
- arg1 (
-
get_3d_view_name
((str_ref)arg1) → None:¶ Get the name of a 3D view if the current view is 3D.
Parameters: arg1 ( geosoft.gxapi.str_ref
) – Name returnedReturns: Nothing Return type: None New in version 5.0.0.
-
get_aoi_area
((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4) → None:¶ Get the area of interest.
Parameters: - arg1 (
geosoft.gxapi.float_ref
) – X Min returned - arg2 (
geosoft.gxapi.float_ref
) – Y Min returned - arg3 (
geosoft.gxapi.float_ref
) – X Max returned - arg4 (
geosoft.gxapi.float_ref
) – Y Max returned
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Coordinates are based on the current view units.
- arg1 (
-
get_box
((str)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5) → int:¶ Returns the coordinates of a user selected box.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X minimum in current view user units. - arg3 (
geosoft.gxapi.float_ref
) – Y - arg4 (
geosoft.gxapi.float_ref
) – X maximum - arg5 (
geosoft.gxapi.float_ref
) – Y
Returns: 0 if point returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
-
get_box2
((str)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5, (float_ref)arg6, (float_ref)arg7, (float_ref)arg8, (float_ref)arg9) → int:¶ Returns the coordinates of a user selected box in a warped view.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X1 bottom left corner - arg3 (
geosoft.gxapi.float_ref
) – Y1 - arg4 (
geosoft.gxapi.float_ref
) – X2 bottom right corner - arg5 (
geosoft.gxapi.float_ref
) – Y2 - arg6 (
geosoft.gxapi.float_ref
) – X3 top right corner - arg7 (
geosoft.gxapi.float_ref
) – Y3 - arg8 (
geosoft.gxapi.float_ref
) – X4 top left corner - arg9 (
geosoft.gxapi.float_ref
) – Y4
Returns: 0 if point returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
Note:
If the data view has a rotational (or other) warp, then the
geosoft.gxapi.GXEMAP.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
((float_ref)arg1, (float_ref)arg2) → None:¶ Returns the coordinates of the currently selected point in view coordinates
Parameters: - arg1 (
geosoft.gxapi.float_ref
) – X coordinate in current user units. - arg2 (
geosoft.gxapi.float_ref
) – Y
Returns: Nothing
Return type: None
New in version 5.0.0.
- arg1 (
-
get_cur_point_mm
((float_ref)arg1, (float_ref)arg2) → None:¶ Returns the coordinates of the currently selected point in mm on map
Parameters: - arg1 (
geosoft.gxapi.float_ref
) – X coordinate in map mm - arg2 (
geosoft.gxapi.float_ref
) – Y
Returns: Nothing
Return type: None
New in version 5.0.0.
- arg1 (
-
get_current_group
((str_ref)arg1) → None:¶ Get the current group name.
Parameters: arg1 ( geosoft.gxapi.str_ref
) – returned group nameReturns: Nothing Return type: None New in version 5.0.0.
Note:
This function operates on the current map.
-
get_current_view
((str_ref)arg1) → None:¶ Get the current view name.
Parameters: arg1 ( geosoft.gxapi.str_ref
) – returned view nameReturns: Nothing Return type: None New in version 5.0.0.
Note:
This function operates on the current map.
-
get_cursor
((float_ref)arg1, (float_ref)arg2) → None:¶ Returns the coordinates of the last known cursor location
Parameters: - arg1 (
geosoft.gxapi.float_ref
) – X coordinate in current view user units - arg2 (
geosoft.gxapi.float_ref
) – Y
Returns: Nothing
Return type: None
New in version 5.0.0.
- arg1 (
-
get_cursor_mm
((float_ref)arg1, (float_ref)arg2) → None:¶ Returns the coordinates of the last known cursor location in mm on map.
Parameters: - arg1 (
geosoft.gxapi.float_ref
) – X coordinate in map mm - arg2 (
geosoft.gxapi.float_ref
) – Y
Returns: Nothing
Return type: None
New in version 5.0.0.
- arg1 (
-
get_display_area
((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4) → None:¶ Get the area you are currently looking at.
Parameters: - arg1 (
geosoft.gxapi.float_ref
) – X Min returned - arg2 (
geosoft.gxapi.float_ref
) – Y Min returned - arg3 (
geosoft.gxapi.float_ref
) – X Max returned - arg4 (
geosoft.gxapi.float_ref
) – Y Max returned
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Coordinates are based on the current view units. For 3D views this will return the full map extents.
- arg1 (
-
get_display_area_raw
((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4) → None:¶ Get the area you are currently looking at in raw map units
Parameters: - arg1 (
geosoft.gxapi.float_ref
) – X Min returned - arg2 (
geosoft.gxapi.float_ref
) – Y Min returned - arg3 (
geosoft.gxapi.float_ref
) – X Max returned - arg4 (
geosoft.gxapi.float_ref
) – Y Max returned
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Coordinates are in millimeters. For 3D views this will return the full map extents.
- arg1 (
-
get_grid
((str)arg1, (int)arg2, (int)arg3, (float_ref)arg4, (float_ref)arg5, (float_ref)arg6, (float_ref)arg7, (float_ref)arg8) → int:¶ Position and size a grid on a map.
Parameters: - arg1 (str) – user prompt string
- arg2 (int) – Number of elements along primary axis to draw.
- arg3 (int) – Number of elements along secondary axis to draw.
- arg4 (
geosoft.gxapi.float_ref
) – Angle of primary axis in degrees - arg5 (
geosoft.gxapi.float_ref
) – Grid origin X - arg6 (
geosoft.gxapi.float_ref
) – Grid origin Y - arg7 (
geosoft.gxapi.float_ref
) – Primary axis length - arg8 (
geosoft.gxapi.float_ref
) – Secondary axis length
Returns: 0 if line returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
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
geosoft.gxapi.GXMVIEW.get_user_ipj()
andgeosoft.gxapi.GXMVIEW.set_user_ipj()
.)
-
get_line
((str)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5) → int:¶ Returns the end points of a line.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X1 in view user units - arg3 (
geosoft.gxapi.float_ref
) – Y1 - arg4 (
geosoft.gxapi.float_ref
) – X2 - arg5 (
geosoft.gxapi.float_ref
) – Y2
Returns: 0 if line returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
Note:
The coordinates are returned in the current User projection (See
geosoft.gxapi.GXMVIEW.get_user_ipj()
andgeosoft.gxapi.GXMVIEW.set_user_ipj()
.)
-
get_line_ex
((str)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5) → int:¶ Returns the end points of a line.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X1 in view user units - arg3 (
geosoft.gxapi.float_ref
) – Y1 - arg4 (
geosoft.gxapi.float_ref
) – X2 - arg5 (
geosoft.gxapi.float_ref
) – Y2
Returns: 0 if line returned. 1 - Right Mouse 2 - Escape/Cancel
Return type: int
New in version 5.0.0.
Note:
The coordinates are returned in the current User projection (See
geosoft.gxapi.GXMVIEW.get_user_ipj()
andgeosoft.gxapi.GXMVIEW.set_user_ipj()
.)
-
get_line_xyz
((str)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5, (float_ref)arg6, (float_ref)arg7) → int:¶ Returns the end points of a line in X,Y and Z
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X1 in view user units - arg3 (
geosoft.gxapi.float_ref
) – Y1 - arg4 (
geosoft.gxapi.float_ref
) – Z1 - arg5 (
geosoft.gxapi.float_ref
) – X2 - arg6 (
geosoft.gxapi.float_ref
) – Y2 - arg7 (
geosoft.gxapi.float_ref
) – Z2
Returns: 0 if line returned. 1 - Right Mouse 2 - Escape/Cancel
Return type: int
New in version 5.0.0.
Note:
The coordinates are returned in the current User projection (See
geosoft.gxapi.GXMVIEW.get_user_ipj()
andgeosoft.gxapi.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
((bool_ref)arg1, (float_ref)arg2, (int_ref)arg3, (int_ref)arg4, (int_ref)arg5, (int_ref)arg6, (int_ref)arg7, (int_ref)arg8) → None:¶ Get the base layout view properties.
Parameters: - arg1 (
geosoft.gxapi.bool_ref
) – bool Snap to grid - arg2 (
geosoft.gxapi.float_ref
) – Snapping distance (always in mm) - arg3 (
geosoft.gxapi.int_ref
) – View Grid - arg4 (
geosoft.gxapi.int_ref
) – View Rulers - arg5 (
geosoft.gxapi.int_ref
) – LAYOUT_VIEW_UNITS constants View Units - arg6 (
geosoft.gxapi.int_ref
) – Grid Red Component (0-255) - arg7 (
geosoft.gxapi.int_ref
) – Grid Green Component (0-255) - arg8 (
geosoft.gxapi.int_ref
) – Grid Blue Component (0-255)
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
This affects the display units and other related properties for the base view of a map.
- arg1 (
-
get_map_snap
((float_ref)arg1) → None:¶ Get current snapping distance in MM
Parameters: arg1 ( geosoft.gxapi.float_ref
) – Snap value in MM (returned)Returns: Nothing Return type: None New in version 5.0.0.
-
static
get_maps_lst
((GXLST)arg1, (int)arg2) → int:¶ Load the file names of open maps into a LST.
Parameters: - arg1 (
geosoft.gxapi.GXLST
) – LST to load - arg2 (int) – EMAP_PATH constants
Returns: The number of documents loaded into the LST. The LST is cleared first.
Return type: int
New in version 5.0.0.
- arg1 (
-
get_name
((str_ref)arg1) → None:¶ Get the name of the map object of this EMAP.
Parameters: arg1 ( geosoft.gxapi.str_ref
) – Name returnedReturns: Nothing Return type: None New in version 5.0.0.
-
get_point
((str)arg1, (float_ref)arg2, (float_ref)arg3) → int:¶ Returns the coordinates of a user selected point.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X coordinate in current view user units. - arg3 (
geosoft.gxapi.float_ref
) – Y
Returns: 0 if point returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
Note:
This will wait for user to select a point.
See also
iTrackPoint, GetCurPoint, GetCursor
-
get_point_3d
((str)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4) → int:¶ Returns the coordinates of a user selected point.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X coordinate in current view user units. - arg3 (
geosoft.gxapi.float_ref
) – Y - arg4 (
geosoft.gxapi.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.0.
Note:
This will wait for user to select a point.
See also
iTrackPoint, GetCurPoint, GetCursor
-
get_point_ex
((str)arg1, (float_ref)arg2, (float_ref)arg3) → int:¶ Returns the coordinates of a user selected point.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X coordinate in current view user units. - arg3 (
geosoft.gxapi.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.0.
Note:
This will wait for user to select a point.
See also
iTrackPoint, GetCurPoint, GetCursor
-
get_poly_line
((str)arg1, (GXVV)arg2, (GXVV)arg3) → int:¶ Returns a polyline.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.GXVV
) – X - arg3 (
geosoft.gxapi.GXVV
) – Y
Returns: 0 if line returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
Note:
The coordinates are returned in the current User projection (See
geosoft.gxapi.GXMVIEW.get_user_ipj()
andgeosoft.gxapi.GXMVIEW.set_user_ipj()
.)
-
get_poly_line_xyz
((str)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4) → int:¶ Returns a polyline.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.GXVV
) – X - arg3 (
geosoft.gxapi.GXVV
) – Y - arg4 (
geosoft.gxapi.GXVV
) – Z
Returns: 0 if line returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
Note:
The coordinates are returned in the current User projection (See
geosoft.gxapi.GXMVIEW.get_user_ipj()
andgeosoft.gxapi.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)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5) → int:¶ Returns the coordinates of a user selected box starting at a corner.
Parameters: - arg1 (str) – user prompt string
- arg2 (
geosoft.gxapi.float_ref
) – X minimum in current view user units. (defines corner) - arg3 (
geosoft.gxapi.float_ref
) – Y - arg4 (
geosoft.gxapi.float_ref
) – X maximum - arg5 (
geosoft.gxapi.float_ref
) – Y
Returns: 0 if point returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
Note:
The coordinates are returned in the current User projection (See
geosoft.gxapi.GXMVIEW.get_user_ipj()
andgeosoft.gxapi.GXMVIEW.set_user_ipj()
.) If the user IPJ 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
((GXVV)arg1, (GXVV)arg2) → None:¶ Get the verticies of selected object
Parameters: - arg1 (
geosoft.gxapi.GXVV
) – X VV Handle - arg2 (
geosoft.gxapi.GXVV
) – Y VV Handle
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Works only in Vertex Edit Mode
- arg1 (
-
get_view_ipj
((str)arg1, (GXIPJ)arg2) → None:¶ Get a view's IPJ.
Parameters: - arg1 (str) – view name
- arg2 (
geosoft.gxapi.GXIPJ
) – IPJ in which to place the view IPJ
Returns: Nothing
Return type: None
New in version 9.1.0.
Note:
This function can be used to obtain a views coordinate system without having to call
geosoft.gxapi.GXEMAP.lock()
. This could be an expensive operation that cause undesirable UX.
-
get_window_position
((int_ref)arg1, (int_ref)arg2, (int_ref)arg3, (int_ref)arg4, (int_ref)arg5, (int_ref)arg6) → None:¶ Get the map window's position and dock state
Parameters: - arg1 (
geosoft.gxapi.int_ref
) – Window left position - arg2 (
geosoft.gxapi.int_ref
) – Window top position - arg3 (
geosoft.gxapi.int_ref
) – Window right position - arg4 (
geosoft.gxapi.int_ref
) – Window bottom position - arg5 (
geosoft.gxapi.int_ref
) – Window state EMAP_WINDOW_STATE constants - arg6 (
geosoft.gxapi.int_ref
) – Docked or floating EMAP_WINDOW_POSITION constants
Returns: Nothing
Return type: None
New in version 9.0.0.
- arg1 (
-
get_window_state
() → int:¶ Retrieve the current state of the map window
Returns: EMAP_WINDOW_STATE constants Return type: int New in version 5.0.0.
-
static
have_current
() → int:¶ 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.0.
-
static
i_get_specified_map_name
((str)arg1, (str)arg2, (str_ref)arg3) → int:¶ Find a loaded map that has a setting in its reg.
Parameters: - arg1 (str) – REG field name
- arg2 (str) – REG field value to find
- arg3 (
geosoft.gxapi.str_ref
) – buffer for map name
Returns: 0 - Ok 1 - No Map Found
Return type: int
New in version 5.0.0.
-
is_3d_view
() → int:¶ Is the current view a 3D view.
Returns: 1 - Yes, 0 - No Return type: int New in version 5.0.0.
-
is_grid
() → int:¶ Is the map a grid map?
Returns: 1 - Yes, 0 - No Return type: int New in version 5.0.0.
-
is_locked
() → bool:¶ Is this Map locked
Returns: bool Return type: bool New in version 5.0.0.
-
is_null
() → bool¶ Check if the instance of
geosoft.gxapi.GXEMAP is null (undefined)
Returns: True if this is a null instance of geosoft.gxapi.GXEMAP
, False otherwise.Return type: bool`
-
static
load
((str)arg1) → GXEMAP:¶ Loads maps into the editor.
Parameters: arg1 (str) – list of maps (‘;’ or ‘|‘ delimited) to load. Returns: EMAP Object to edited map. Return type: geosoft.gxapi.GXEMAP
New in version 5.0.0.
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.
-
static
load_control
((str)arg1, (HWND)arg2) → None:¶ Version of
geosoft.gxapi.GXEMAP.load()
that can be used to load a database via subclassing into a Windows control.Parameters: - arg1 (str) – Map filename
- arg2 (
geosoft.gxapi.HWND
) – Window handle to receive document
Returns: Nothing
Return type: None
New in version 5.0.0.
-
static
load_no_activate
((str)arg1) → GXEMAP:¶ Loads documents into the workspace
Parameters: arg1 (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: geosoft.gxapi.GXEMAP
New in version 5.0.0.
Note:
This function acts just like
geosoft.gxapi.GXEMAP.load()
except that the document(s) is not activated (brought to foreground) and no guarantee is given about which document is currently active.
-
static
load_with_view
((str)arg1, (GXEMAP)arg2) → GXEMAP:¶ Load an EMAP with the view from a current EMAP.
Parameters: - arg1 (str) – Source Map name
- arg2 (
geosoft.gxapi.GXEMAP
) – EMAP to use as the source view
Returns: New EMAP handle.
Return type: New in version 5.0.0.
Note:
Can only be run in interactive mode. Is used by dbsubset to create a new database with the same view as previously.
-
static
load_with_view_control
((str)arg1, (GXEMAP)arg2, (HWND)arg3) → None:¶ Version of
geosoft.gxapi.GXEDB.load_with_view()
that can be used to load a database via subclassing into a Windows control.Parameters: - arg1 (str) – Map filename
- arg2 (
geosoft.gxapi.GXEMAP
) – EMAP handle to use as the source view - arg3 (
geosoft.gxapi.HWND
) – Window handle to receive document
Returns: Nothing
Return type: None
New in version 5.0.0.
-
static
loaded
((str)arg1) → int:¶ Returns 1 if a map is loaded .
Parameters: arg1 (str) – map name Returns: 1 if map is loaded, 0 otherwise. Return type: int New in version 5.0.0.
-
lock
() → GXMAP:¶ This method locks the Edited map.
Returns: EMAP Object to map associated with edited map. Return type: geosoft.gxapi.GXMAP
New in version 5.0.0.
Note:
The Redraw flag is set to EMAP_REDRAW_YES when this functions is called.
-
make_current
() → None:¶ Makes this EMAP object the current active object to the user.
Returns: Nothing Return type: None New in version 5.0.0.
-
static
null
() → GXEMAP¶ A null (undefined) instance of
geosoft.gxapi.GXEMAP
Returns: A null geosoft.gxapi.GXEMAP
Return type: geosoft.gxapi.GXEMAP
-
packed_files
() → int:¶ The number of packed files in the map.
Returns: The number of packed files in map. Return type: int New in version 9.2.0.
-
print
((int)arg1, (int)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6, (int)arg7, (int)arg8, (float)arg9, (int)arg10, (int)arg11, (int)arg12, (str)arg13) → None:¶ Print the current map to current printer.
Parameters: - arg1 (int) – lEntireMap (0 or 1)
- arg2 (int) – lScaleToFit 0 - use scale factor 1 - fit to media 2 - fit to roll media
- arg3 (int) – lPrintToFile(0 or 1)
- arg4 (int) – lAllPages (0 or 1)
- arg5 (int) – lCentre (0 or 1)
- arg6 (int) – lCopies
- arg7 (int) – lFirstPage
- arg8 (int) – lLastPage
- arg9 (float) – dScaleFactor (2.0 doubles plot size)
- arg10 (int) – lOverlapSize (mm)
- arg11 (int) – lOffsetX (mm)
- arg12 (int) – lOffsetY (mm)
- arg13 (str) – szFile (if lPrintToFile==1)
Returns: Nothing
Return type: None
New in version 5.0.0.
-
read_only
() → bool:¶ Checks if a map is currently opened in a read-only mode.
Returns: bool Return type: bool New in version 5.0.0.
-
redraw
() → None:¶ Redraw the map immediately.
Returns: Nothing Return type: None New in version 5.0.0.
Note:
Redraws the map immediately. Map must not be locked.
-
static
reload_grid
((str)arg1) → None:¶ Reloads a grid document.
Parameters: arg1 (str) – Source file name Returns: Nothing Return type: None New in version 9.0.0.
Note:
Use this method to reload (if loaded) a grid document if the file on disk changed.
-
select_group
((str)arg1) → None:¶ Select a group.
Parameters: arg1 (str) – “View/Group” Returns: Nothing Return type: None New in version 5.0.0.
-
set_aoi_area
((float)arg1, (float)arg2, (float)arg3, (float)arg4) → None:¶ Set the area of interest.
Parameters: - arg1 (float) – X Min
- arg2 (float) – Y Min
- arg3 (float) – X Max
- arg4 (float) – Y Max
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Coordinates are based on the current view user units. The map is immediatly redrawn.
-
set_current_view
((str)arg1) → int:¶ Set the current working view.
Parameters: arg1 (str) – view name Returns: 0 if view set, 1 if view does not exist. Return type: int New in version 5.0.0.
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
((float)arg1, (float)arg2, (float)arg3, (float)arg4) → None:¶ Set the area you wish to see.
Parameters: - arg1 (float) – X Min
- arg2 (float) – Y Min
- arg3 (float) – X Max
- arg4 (float) – Y Max
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Coordinates are based on the current view user units. The map is immediatly redrawn.
-
set_drag_drop_enabled
((bool)arg1) → None:¶ Set whether drag-and-drop is enabled for the map.
Parameters: arg1 (bool) – Enables/disables drag-and-drop bool Returns: Nothing Return type: None New in version 5.0.0.
-
set_map_layout_props
((bool)arg1, (float)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6, (int)arg7, (int)arg8) → None:¶ Set the base layout view properties.
Parameters: - arg1 (bool) – bool Snap to grid
- arg2 (float) – Snapping distance (always in mm)
- arg3 (int) – View Grid
- arg4 (int) – View Rulers
- arg5 (int) – LAYOUT_VIEW_UNITS constants View Units
- arg6 (int) – Grid Red Component (0-255)
- arg7 (int) – Grid Green Component (0-255)
- arg8 (int) – Grid Blue Component (0-255)
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
This affects the display units and other related properties for the base view of a map.
-
set_map_snap
((float)arg1) → None:¶ Set current snapping distance in MM
Parameters: arg1 (float) – Snap value in MM Returns: Nothing Return type: None New in version 5.0.0.
-
set_redraw_flag
((int)arg1) → None:¶ Set the redraw flag.
Parameters: arg1 (int) – EMAP_REDRAW constants Returns: Nothing Return type: None New in version 5.0.0.
Note:
This function is generally used to prevent redrawing of the map, which normally occurs after the last
geosoft.gxapi.GXEMAP.un_lock()
call, in cases where it is known that no changes are being made to the map. Typical usage: ap =geosoft.gxapi.GXEMAP.lock()
(EMap); etRedrawFlag_EMAP(EMap,EMAP_REDRAW_NO); Stuff....geosoft.gxapi.GXEMAP.un_lock()
(Map);
-
set_viewport_mode
((int)arg1) → None:¶ Set the viewport mode.
Parameters: arg1 (int) – EMAP_VIEWPORT constants Returns: Nothing Return type: None New in version 5.0.0.
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
((int)arg1, (int)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6) → None:¶ Get the map window's position and dock state
Parameters: - arg1 (int) – Window left position
- arg2 (int) – Window top position
- arg3 (int) – Window right position
- arg4 (int) – Window bottom position
- arg5 (int) – Window state EMAP_WINDOW_STATE constants
- arg6 (int) – Docked or floating EMAP_WINDOW_POSITION constants
Returns: Nothing
Return type: None
New in version 9.0.0.
-
set_window_state
((int)arg1) → None:¶ Changes the state of the map window
Parameters: arg1 (int) – EMAP_WINDOW_STATE constants Returns: Nothing Return type: None New in version 5.0.0.
-
track_point
((int)arg1, (float_ref)arg2, (float_ref)arg3) → int:¶ Get point without prompt or cursor change with tracking
Parameters: - arg1 (int) – EMAP_TRACK constants
- arg2 (
geosoft.gxapi.float_ref
) – X coordinate in current view user units. - arg3 (
geosoft.gxapi.float_ref
) – Y
Returns: 0 if point returned. 1 if user cancelled.
Return type: int
New in version 5.0.0.
-
static
un_load
((str)arg1) → None:¶ Unloads a MAP.
Parameters: arg1 (str) – Name of the map to unload Returns: Nothing Return type: None New in version 5.0.0.
Note:
If the MAP is not loaded, nothing happens. Same as
geosoft.gxapi.GXEMAP.un_load_verify()
with FALSE to prompt save.
-
static
un_load_all
() → None:¶ Unloads all opened maps
Returns: Nothing Return type: None New in version 5.0.0.
-
static
un_load_verify
((str)arg1, (bool)arg2) → None:¶ Unloads an edited map, optional prompt to save.
Parameters: - arg1 (str) – Name of map to unload
- arg2 (bool) – Prompt? bool
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
If the map is not loaded, nothing happens. If "FALSE", map is saved without a prompt.
-
un_lock
() → None:¶ This method unlocks the Edited map.
Returns: Nothing Return type: None New in version 5.0.0.
-
EMAP_PATH constants¶
Four forms
-
gxapi.
EMAP_PATH_FULL
= 0¶
d:\directory\file.gdb
-
gxapi.
EMAP_PATH_DIR
= 1¶
\directory\file.gdb
-
gxapi.
EMAP_PATH_NAME_EXT
= 2¶
file.gdb
-
gxapi.
EMAP_PATH_NAME
= 3¶
file
EMAP_REMOVE constants¶
How to handle pending changes in document
-
gxapi.
EMAP_REMOVE_SAVE
= 0¶
-
gxapi.
EMAP_REMOVE_PROMPT
= 1¶
-
gxapi.
EMAP_REMOVE_DISCARD
= 2¶
EMAP_TRACK constants¶
Tracking Options
-
gxapi.
EMAP_TRACK_ERASE
= 1¶
Erase Object after you return?
-
gxapi.
EMAP_TRACK_RMENU
= 2¶
Allow use of right-menu
-
gxapi.
EMAP_TRACK_CYCLE
= 4¶
If user holds down left-mouse, will return many times
EMAP_VIEWPORT constants¶
Tracking Options
-
gxapi.
EMAP_VIEWPORT_NORMAL
= 0¶
Normal map usage
-
gxapi.
EMAP_VIEWPORT_BROWSEZOOM
= 1¶
Zoom Mode
-
gxapi.
EMAP_VIEWPORT_BROWSEAOI
= 2¶
Change Area Of Interest Mode
EMAP_WINDOW_POSITION constants¶
Window Positioning Options
-
gxapi.
EMAP_WINDOW_POSITION_DOCKED
= 0¶
-
gxapi.
EMAP_WINDOW_POSITION_FLOATING
= 1¶