0

User Interface in Scripting

Yan 9 years ago in Scripting updated 9 years ago 0
A lot of people are now using python scripting, to automate tasks in Micromine; it is easy to use, and a lot more powerful than macros. 
Our goal is to make it easier to use and to share scripts with colleagues. This is why we added 3 new user interface functions to the MMpy module:
  • Save File Dialog
  • Load File Dialog
  • Message Box

Save File Dialog
This function prompt the user to select a location for saving a file.

filePath = MMpy.GUI.save_dialog(filter = "Micromine Files|*.DAT;*.STR;*.SVY|All Files|*.*||")
Image 677

Load File Dialog
This function prompt the user to open a file and return the selected path.
filePath = MMpy.GUI.load_dialog(title = "Load Dialog Title",default = "c:\\file.txt")
Image 678

Message Box
Display a dialog box that contains a system icon, a set of buttons and a message.

result = MMpy.GUI.message_box("Do you want to process ?", MMpy.MessageBoxFormat.yes_no)
Image 679

These functions are going to be available in the upcoming service pack (SP3) and the different options are described in the scripting documentation.