GXARCMAP class

class geosoft.gx.GXARCMAP
This library is not a class. It contains various utilities
used in maps and layers by the Geosoft extensions for ArcGIS.
static change_size((GXContext)ctx, (float)arg1, (float)arg2) → None:
Changes the custom page size of the ArcGIS Map document.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (float) – X Size (mm)
  • arg2 (float) – Y Size (mm)
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static display_in_3d_view((GXContext)ctx, (str)arg1) → None:
Display a file in 3D view
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static export_feature_layer_by_name_to_3d_file((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3, (str)arg4) → None:
Exports the shapes from a feature layer of the ArcMap document to a 3D File.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – MXD filename
  • arg2 (str) – Dataframe name
  • arg3 (str) – Layer name
  • arg4 (str) – output file name
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static export_selected_feature_layer_to_3d_file((GXContext)ctx, (str)arg1) → None:
Exports the shapes from the currently selected feature layer (if any) in ArcMap to a 3D file (only on oriented frames i.e. sections).
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static get_current_document_info((GXContext)ctx, (str_ref)arg1, (str_ref)arg2, (str_ref)arg3) → None:
Get some info on the current MXD in ArcMap and selected layer (if any)
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static get_ipj_for_predefined_esri_gcs((GXContext)ctx, (GXIPJ)arg1, (int)arg2) → None:
Fills an IPJ with a predefined ESRI GCS
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.1.

static get_ipj_for_predefined_esri_pcs((GXContext)ctx, (GXIPJ)arg1, (int)arg2) → None:
Fills an IPJ with a predefined ESRI PCS
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.1.

static get_load_map((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3, (int)arg4) → int:
Loads a Geosoft map into the ArcMap document.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Map File Name
  • arg2 (str) – Optional Extra Datasets CSV Filename (Rasters and shape files to display with layers)
  • arg3 (str) – Optional frame/layer tag (suffix)
  • arg4 (int) – Combination of ARCMAP_LOAD_FLAGS constants
Returns:

0 - OK 1 - Error -1 - Canceled

Return type:

int

New in version 8.0.0.

Note:

The extra datasets CSV should contain the the following fields:

 ID          -  Unique identifier
 DATASOURCE  -  Filename
 TYPE        -  RASTER and SHAPE supported
 MAPMATCH    -  Map to associate with (used for grouping logic)
 VIEWMATCH   -  View to match with in associated map (used for grouping logic)
 ZONEFILE    -  Used for type RASTER
static get_load_shape((GXContext)ctx, (str)arg1, (int)arg2) → int:
Load a shape file into ArcMap.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – shape file to load
  • arg2 (int) – delete existing layers?
Returns:

0- OK, 1 - Error, -1 - Cancel

Return type:

int

New in version 8.0.0.

static get_number_of_selected_layers((GXContext)ctx) → int:
Get the number of selected layers in the TOC

Returns                                                                       The number of layers selected.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Return type:int

New in version 8.0.0.

static get_selected_layer_info((GXContext)ctx, (int)arg1, (str_ref)arg2, (str_ref)arg3) → None:
Get the name info on the specified selected layer
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static load_lyr((GXContext)ctx, (str)arg1) → None:
Load a LYR file to the current data frame
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static load_map((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3, (str)arg4, (bool)arg5, (bool)arg6, (bool)arg7) → None:
Loads a Geosoft map into the current ArcMap document
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Map File Name
  • arg2 (str) – View Name
  • arg3 (str) – Optional Extra Datasets CSV Filename (Rasters and shape files to display with layers)
  • arg4 (str) – Optional frame/layer tag (suffix)
  • arg5 (bool) – Fit to map size; one of bool
  • arg6 (bool) – Activate view (3D); one of bool
  • arg7 (bool) – Layer name tag is prefix; one of bool
Returns:

Nothing

Return type:

None

New in version 8.0.0.

Note:

The extra datasets CSV should contain the the following fields:

    ID          -  Unique identifier
    DATASOURCE  -  Filename
    TYPE        -  RASTER and SHAPE supported
    MAPMATCH    -  Map to associate with (used for grouping logic)
    VIEWMATCH   -  View to match with in associated map (used for grouping logic)
    ZONEFILE    -  Used for type RASTER
static load_map_ex((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3, (str)arg4, (int)arg5) → int:
Loads a Geosoft map into the ArcMap document, specifying which View to use as Data view.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Map File Name
  • arg2 (str) – View Name
  • arg3 (str) – Optional Extra Datasets CSV Filename (Rasters and shape files to display with layers)
  • arg4 (str) – Optional frame/layer tag (suffix)
  • arg5 (int) – Combination of ARCMAP_LOAD_FLAGS constants
Returns:

0 - OK 1 - Error -1 - Canceled

Return type:

int

New in version 8.0.0.

Note:

The extra datasets CSV should contain the the following fields:

 ID          -  Unique identifier
 DATASOURCE  -  Filename
 TYPE        -  RASTER and SHAPE supported
 MAPMATCH    -  Map to associate with (used for grouping logic)
 VIEWMATCH   -  View to match with in associated map (used for grouping logic)
 ZONEFILE    -  Used for type RASTER
static load_map_view((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3, (int)arg4) → None:
Load a Geosoft Map as a layer into the current data frame
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Map File Name
  • arg2 (str) – View Name
  • arg3 (str) – Layer Name
  • arg4 (int) – Pass TRUE to also render other views in map (Use second parameter view for location)
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static load_raster((GXContext)ctx, (str)arg1) → None:
Load a raster file to the current data frame
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.0.

Note:

Loads any file type recognized as "raster" formats by ARC GIS.
This includes geosoft GRD files.
static load_shape((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3) → None:
Load a SHP file to the current data frame
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – File Name
  • arg2 (str) – Layer Name Prefix: An underscore is added automatically
  • arg3 (str) – Layer Name Suffix An underscore is added automatically
Returns:

Nothing

Return type:

None

New in version 8.0.0.

Note:

The input layer name is created using the (optional) prefix and suffix as follows:

Prefix_NAME_Suffix
static load_spf((GXContext)ctx, (str)arg1, (int)arg2) → int:
Load all the shape files generated by importing a SPF into ArcMap.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – list of shape files to load
  • arg2 (int) – number of shape files
Returns:

0- OK, 1 - Error, -1 - Cancel

Return type:

int

New in version 8.0.0.

static map_view_to_shape((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3, (GXLST)arg4) → None:
Create SHP file(s) from a Geosoft Map view.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – Map File Name
  • arg2 (str) – View Name
  • arg3 (str) – SHP File Name
  • arg4 (geosoft.gx.GXLST) – List to fill with shape files created
Returns:

Nothing

Return type:

None

New in version 8.0.0.

Note:

The output SHP file name(s) are made up as follows
(where NAME is the input SHP file name):

      NAME_pt.shp    (point objects)
      NAME_ln.shp    (line or arc objects)
      NAME_pg.shp    (polygon objects)
static query_size((GXContext)ctx, (float_ref)arg1, (float_ref)arg2) → None:
Querie the page size in mm of the entire map page.
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static show_layer_by_name_in_3d((GXContext)ctx, (str)arg1, (str)arg2, (str)arg3) → None:
Shows a layer in ArcMap in a 3D view in an MXD
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – MXD filename
  • arg2 (str) – Dataframe name
  • arg3 (str) – Layer name
Returns:

Nothing

Return type:

None

New in version 8.0.0.

static show_selected_layers_in_3d((GXContext)ctx) → None:
Shows the selected layers in ArcMap in a 3D view
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:Nothing
Return type:None

New in version 8.0.0.

ARCMAP_LOAD_FLAGS constants

Flags that can be combined and passed to iLoadMap_ARCMAP
gx.ARCMAP_LOAD_DELFRAME = 1
If an exisiting frame is found delete it
gx.ARCMAP_LOAD_DELLAYER = 2
If an exisiting layer is found delete it
gx.ARCMAP_LOAD_EXISTFRAME = 4
If an exisiting frame is found add new layers to it
gx.ARCMAP_LOAD_COPYLAYER = 8
If an exisiting layer is found make a copy
gx.ARCMAP_LOAD_HIDESIBLINGS = 16
Hide all other existing layers in frame
gx.ARCMAP_LOAD_PREFIXMAPFRAME = 32
Prefix the map filename part as part of the frame name
gx.ARCMAP_LOAD_PREFIXMAPLAYER = 64
Prefix the map filename part as part of the layer name
gx.ARCMAP_LOAD_MERGETOSINGLEVIEW = 128
Will render all views in single layer with the data view defining the coordinate system
gx.ARCMAP_LOAD_INTOCURRENTFRAME = 256
Load everything into the current data frame
gx.ARCMAP_LOAD_NOMAPLAYERS = 512
Use the map only for sizing data frames in layout, only load extra datasets.
gx.ARCMAP_LOAD_ACTIVATE = 1024
Activates the main quickmap layer when done (e.g. 3D Viewer)
gx.ARCMAP_LOAD_NEW = 2048
New method for loading maps introduced in 7.1. Will mimic what happens in montaj (i.e. base groups and 3D become graphics and views gets split into separate LYRs).
gx.ARCMAP_LOAD_NAMETAGISPREFIX = 4096
Use a provided name tag as prefix when naming a newly created map layer.