attrtoascii

Table of Contents

Introduction

Convert attributed geometry MSR to Concsa input files.

Read attributed geometry from drillhole design tool, and write out collar, assay file for Concsa. The attributed geometry is assumed to be polyline segments, that have been created by Drillhole design tool.

To execute either use the command line, or via MineSight Grail Embedded.

Usage

Prior to executing the attrtoascii.py script you will require a attributed MSR file created using the Drillhole Design Tool from MS-3D.

You can execute attrtoascii.py in one of several ways. Each method will spawn a dialog that will allow you configure the results. You can define,

  • The attributed geometry file to read.
  • The name of the collar, survey and assay output files.
  • The directory that you wish to output the results into.
  • Whether or not you want the format to be in CSV format.

The different methods to execute attrtoascii.py are outlined below,

Via that Command Line

To run attrtoascii.py from the command line type the following,

python attrtoascii.py

Via the Embedded Grail (MSGe)

From within MS-3D select File->Run Script and select the attrtoascii.py script.

Via a Window's shortcut

Ensure you have %PYTHONHOME% define as a environment variable and that %MEDEXE% is available on your system path.

  1. Right click on your desktop.
  2. Select NEW->SHORTCUT
  3. Browse to find your attrtoascii.py script (we will call it c:\attrtoascii.py for the purposes of this example).
  4. Click NEXT.
  5. Name it attrtoascii.py
  6. Click OK.
  7. Right click on the new shortcut.
  8. Select PROPERTIES.
  9. In the TARGET field insert "%PYTHONHOME%pythonw.exe" prior to c:\attrtoascii.py path.

Double click on the new icon to start the script.

Via another script

The attrtoascii.py script can also be used as module within your own script. Ensure that the attrtoascii.py script (an associated support scripts) are somewhere on your %PYTHONPATH% or within the same directory as your script. In your script you would do the following,

import attrtoascii

msrpath = "c:\\mydir\\myattr.msr"
collarpath = "c:\\mydir\\collar.dat"
surveypath = "c:\\mydir\\survey.dat"
assaypath = "c:\\mydir\\assay.dat"

attrtoascii.attr_to_ascii(msrpath,
                          collarpath,
                          surveypath,
                          assaypath)

You may also optionally specify that you want the contents dumped in CSV format by setting the "iscsv" keyword to 1 as in,

attrtoascii.attr_to_ascii(msrpath,
                          collarpath,
                          surveypath,
                          assaypath,
                          iscsv=1)

One trick you can do to make sure the "import attrtoascii" works is the following,

import os
import sys

# Insert the location of the attrtoascii file.
addPath = os.environ["MEDEXE"]\scripts\attrtoascii
sys.path = sys.path.insert(0, addPath)

import attrtoascii

This will make sure that when python imports attrtoascii, it will know to look into the %MEDEXE%\scripts\attrtoascii directory.

CSV File Format

The attrtoascii.py script allows you output the contents of a script in a CSV format. Each file has a CSV header that appears as follows,

Collar File:

DHID, Easting, Northing, Elevation, Azimuth, Dip, Depth

Survey File:

DHID, SurveyFrom, SurveyTo, SurveyLength, SurveyAzimuth, SurveyDip

Assay File:

DHID, AssayFrom, AssayTo, Value1

Revision History

25.04.2006, REF#6029
  • Add check to skip polylines that have only one point.
  • Print message to MS3D window with name of polyline skipped.

License Agreement

The Original Code is attrtoascii.py.

The Initial Developer of the Original Code is Leica Geosystems. Portions created by Leica Geosystems are Copyright (C) 2014 year. Leica Geosystems. All Rights Reserved.