==================================== ``grail.data.modelgenerator`` Module ==================================== .. include:: ..\..\version.h .. contents:: Table of Contents :backlinks: top -------- Overview -------- This module provides the ability to create and initialize a new model file (file 13 or file 15). -------- Examples -------- The following snippet illustrates how to create a 3-D Block Model. In this example, the model file created would be named "test15.dat". .. Python:: pcfpath = "C:/test10.dat" items=[] items.append(("TOPO", 1, 100, .1)) #name, min, max, precision items.append(("GRADE", 0, 1, .001)) items.append(("CU", 0, 1, .001)) modelfile = modelgenerator.createModel(pcfpath, items, 15, "dat") --------- Functions --------- :df:`createModel(pcfPath, itemInfo, fileType, extension)` Creates a new model file given the PCF, a list of item information, the file type, and the file extension. Returns the filename of the newly created model (uses the prefix of the pcfPath). Arguments: :a:`pcfPath` : string The path to the PCF file which the block model will be associated with. :a:`itemInfo` : list A list of tuples representing the custom items to be added to the model: (name, min, max, precision) :a:`fileType` : integer Must be either 15 (for a 3-D Block Model) or 13 (for a 2-D Surface file) :a:`extension` : string A three-character string which will become the file extension of the new model file (i.e. "dat")