MS3D Scripts An Introduction 200904
MS3D Scripts An Introduction 200904
MS3D Scripts An Introduction 200904
MineSight is a powerful 3D data modeling and visualization package that offers great flexibility for geologic modeling, mine
planning, design, and evaluation. Scripts add to this flexibility by providing access to a wide variety of additional functionality.
Prefix
No Prefix
CP
EM
IP
Batch IP
Description
Script is executed either as a standalone from Windows
Explorer or a Command Prompt, or from MS3D:
File | Scripts (e.g., shellRpt.pyo)
Script is executed as a MSCompass Procedure
(e.g., cp-ModelCalcTool.pyc)
Script is executed within MS3D: File | Scripts
(e.g., em-polystats.py)
Script is executed from MSIP Cut Design dialog
(e.g., ip-accum.py)
Script is executed in batch mode outside MineSight, using
data collected from a MineSight Planning Database (MSPD)
that has been populated with reserves data from MSIP.
(e.g., batch-ip-summary.py)
Location in winexe
winexe\scripts
winexe\metlib
winexe\scripts
winexe\scripts\reserve
winexe\scripts\reserve
April 2009
April 2009
Figure 1. The new MPython Command Prompt. Notice the messages at the top indicating that
MPython is being used.
Scripts can also be run from the standard Windows command prompt using the
MPython command file (winexe\mpython.cmd). The syntax is mpython
scriptName.py as shown in Figure 2 below:
Figure 2. Scripts can be run using MPython from the standard Windows command prompt.
Figure 3. The File Types panel of the Folder Options in Windows Explorer.
Once this is done, when you click right on a file with the
edited extension (in this case, a *.pyo file), you should see
the Run with MPYTHON option on the right click menu:
Figure 5. The Run with MPYTHON option on the right click menu.
If you are not using any other version of Python, you can
configure all Python script extensions to open with MPython
by default when run from Windows Explorer. This can also be
done from the File Types panel in the Folder Options shown in
Figure 6. Select the appropriate file extension (*.py, *.pyo,
or *.pyc) and click the Change button. This will bring up
a dialog that prompts you to choose a program to open
the file type. If MPython is an option, select it and click OK.
Otherwise, click Browse and navigate to mpython.cmd in
the winexe directory. Select it, and click OK to set mpython.
cmd as the default for opening each file type.
April 2009
Figure 6. Set the default program for executing all Python scripts. If MPython does not appear in the Open
With dialog, add it using the Browse option.
Now, you will be able to simply double click scripts with these extensions from Windows
Explorer and run them normally, as it was in earlier versions of MineSight.
April 2009
First, create a new text file using Notepad. Save the file as
IP_Accum.bat (or some other *.bat file). The text of the
batch file should use the following format:
Figure 10. Basic format for specifying the DSN (with login information) as
well as the IP Set in the batch ip script.
With the DSN and IP Set specified within the Python script,
you no longer need to include this information in the batch
file. The following format can be used for the batch file when
the DSN and IP Set are specified in the Python script:
Figure 11. If the DSN and IP Set are specified in the script, they can be
omitted from the batch file.
Figure 9. Basic format for a batch file including DSN username and
password information.
April 2009