GXMAPTEMPLATE class¶
-
class
geosoft.gx.
GXMAPTEMPLATE
¶ A MAPTEMPLATE wraps and provides manipulation and usage for the XML content in map template files. See the annotated schema file maptemplate.xsd in the <GEOSOFT>maptemplate folder and the accompanying documentation in that folder for documentation on the file format.
-
commit
() → None:¶ Commit any changes to the map template to disk
Returns: Nothing Return type: None New in version 6.3.0.
-
static
create
((GXContext)ctx, (str)arg1, (str)arg2, (int)arg3) → GXMAPTEMPLATE:¶ Create a MAPTEMPLATE from an existing file.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (str) – Map Template file name
- arg2 (str) – Map Template base template to create from
- arg3 (int) – MAPTEMPLATE_OPEN constants
Returns: MAPTEMPLATE Object
Return type: New in version 6.3.0.
Note:
The base template name should be the file name part of a geosoft_maptemplate file in the <geosoft>maptemplate or <geosoftuser>maptemplate folders. A base file in the user folder will override any in the Geosoft install dir.
- ctx (
-
create_map
((str)arg1, (str)arg2) → None:¶ Create a map from the map template
Parameters: - arg1 (str) – New map file name (if it exists it will be overwritten)
- arg2 (str) – Group name to use for settings
Returns: Nothing
Return type: None
New in version 6.3.0.
-
discard
() → None:¶ Discard all changes made to the map template and reload from disk.
Returns: Nothing Return type: None New in version 6.3.0.
-
get_file_name
((str_ref)arg1) → None:¶ Get the file name of the map template.
Parameters: arg1 ( geosoft.gx.str_ref
) – returned map template file nameReturns: Nothing Return type: None New in version 6.3.0.
-
get_tmp_copy
((str_ref)arg1) → None:¶ Get a temporary XML file for manipulation of the map template.
Parameters: arg1 ( geosoft.gx.str_ref
) – returned temporary map template file nameReturns: Nothing Return type: None New in version 6.3.0.
Note:
After manipulating contents the object may be updated by a call to the UpdateFromTmpCopy method.
-
is_null
() → bool¶ Check if the instance of
geosoft.gx.GXMAPTEMPLATE is null (undefined)
Returns: True if this is a null instance of geosoft.gx.GXMAPTEMPLATE
, False otherwise.Return type: bool`
-
static
null
() → GXMAPTEMPLATE¶ A null (undefined) instance of
geosoft.gx.GXMAPTEMPLATE
Returns: A null geosoft.gx.GXMAPTEMPLATE
Return type: geosoft.gx.GXMAPTEMPLATE
-
refresh
() → None:¶ Refresh the map template with any newly saved items
Returns: Nothing Return type: None New in version 7.0.0.
-
render_preview
((int)arg1, (int)arg2, (int)arg3, (int)arg4, (int)arg5) → None:¶ Create a preview of the map template onto a Windows DC handle
Parameters: - arg1 (int) – DC Handle
- arg2 (int) – left value of the render rect in Windows coordinates (bottom>top)
- arg3 (int) – bottom value
- arg4 (int) – right value
- arg5 (int) – top value
Returns: Nothing
Return type: None
New in version 6.3.0.
-
render_preview_map_production
((int)arg1, (int_ref)arg2, (int_ref)arg3, (int_ref)arg4, (int_ref)arg5) → None:¶ Render a preview for map sheet production purposes
Parameters: - arg1 (int) – DC Handle (pass 0 to just query the Data view pixel location)
- arg2 (
geosoft.gx.int_ref
) – left value of the render rect in Windows coordinates (bottom>top) - arg3 (
geosoft.gx.int_ref
) – bottom value - arg4 (
geosoft.gx.int_ref
) – right value - arg5 (
geosoft.gx.int_ref
) – top value
Returns: Nothing
Return type: None
New in version 6.4.0.
Note:
This method can also be used to get the data view pixel location by passing a null DC handle. This help to plot the view contents preview from another location.
-
update_from_tmp_copy
((str)arg1) → None:¶ Update the object contents from a temporary XML file that may have bee manipulated externally.
Parameters: arg1 (str) – Temporary map template file name Returns: Nothing Return type: None New in version 6.3.0.
Note:
This method will not modify the original contents of the file until a call to the the Commit method is made or the object is destroyed. A call to the Discard method will restore the contents to that of the original file. The temporary file is not deleted and should be to not leak file resources.
-