Table of Contents
This document outlines how to add a menu entry to MineSight® 3D for an embedded MineSight® Grail Script.
In order to add scripts as menu options directly into MineSight® 3D, the proper folder structure must be in place.
If they do not exist, you must create a "plugin" directory within the same directory as ms3d.exe and add "scriptmenu" as a sub-directory.
<ms3d.exe path>\plugin\scriptmenu
You will be working within the "scriptmenu" directory.
A configuration file is a text file which outlines which menu items you want to add to the MineSight® 3D menu and where they should be placed.
All configuration files must be named "menuConfig.mni".
Each line in the configuration file corresponds to one element added to the menu system. Each element consists of a TYPE and some properties.
There are 4 types of elements which can be added to the menu:
Properties describe the element and allow you to specify where and how and element is displayed.
The element type will determine if a property is required, optional, or even applicable. For a full listing of properties and options, please go here.
Below is a list of properties. They key for the property is specified in parenthesis
The configuration file is delimited using commas with one element per line.
This would produce a menu item like this:
Keywords are used to denote where in the menu an element should be placed.
Here is an example of a configuration file which chains keywords:
ROOT, tag= operations, title = OperationsSUBMENU, kw = operations, tag = submenu1, title = SubMenu, mnemonic = SGROUP, kw = operations, kw = submenu1, tag =subMenuGroupITEM, kw = operations, kw = submenu1, kw = subMenuGroup, tag = script1, title = Script 1, mnemonic = 1, script = pypdkScript1.pyITEM, kw = operations, kw = submenu1, kw = subMenuGroup, tag = script2, title = Script 2, mnemonic = 2, script = pypdkScript2.pyGROUP, kw = operations, tag = group2ITEM, kw = operations, kw = group2, tag = script3, title = Script 3, mnemonic = 3, script = pypdkScript3.py
This produces a a menu like this:
Once you have your configuration file and scripts written and you have your directory structure set up, you can now get your scripts to appear as menu items.
In order to allow easy addition of scripts new scripts without worrying about naming conflicts or overwriting another's work, each "unit" of related scripts should be placed into a separate folder with the configuration file.
This means that within the scriptmenu directory, you will have 1 or more other sub-directories of related scripts and configuration files.
e.g. <ms3d.exe path>\plugin\scriptmenu\OreControl
The benefit of splitting the scripts up in such a manner allows you to more easily organize your files. In addition, each group is standalone, i.e. it does not rely on any other groups of scripts to ensure that the menu structure is in place.
For example, a second configuration file in another directory could contain ROOT, tag = operations, title = Operations. You will still only see one Operations root menu item.
- A configuration file in the scriptmenu directory will not be evaluated for adding to the menu. You must use a sub-directory.
- Sub-directories will not be recursively searched for configuration files. menuConfig.mni must be at the top of the sub-directory.
- Errors in the configuration file will not trigger any notification. If your item is not where you expected it to be, it will often be in the MineSight menu.