The mdb is the base object of the model database.
A new model database is created by Mdb()
. A new default model will be created as well:
>>> Mdb()
A new model database has been created.
The model "Model-1" has been created.
mdb
>>>
The mdb contains the following constructors:
>>> [i for i in dir(mdb) if i[0].isupper()]
['AdaptivityProcess', 'Annotation', 'Arrow', 'Coexecution', 'CombineOptResults', 'Job', 'JobFromInputFile',
'Model', 'ModelFromAnsysInputFile', 'ModelFromInputFile', 'ModelFromNastranInputFile', 'ModelFromOdbFile',
'OptimizationProcess', 'Text']
Two important (or commonly used anyways) constructors are Model()
>>> mdb.Model(name='M2')
The model "M2" has been created.
mdb.models['M2']
and Job()
:
>>> mdb.Job(name='Job2', model='M2')
mdb.jobs['Job2']
More on models and jobs on the pages Models and Managing jobs
Other properties and methods are:
>>> [i for i in dir(mdb) if i[0].islower()]
['acis', 'adaptivityProcesses', 'annotations', 'close', 'closeAuxMdb', 'coexecutions', 'copyAuxMdbModel',
'getAuxMdbModelNames', 'jobs', 'lastChangedCount', 'meshEditOptions', 'models', 'openAcis', 'openAuxMdb',
'openCatia', 'openEnf', 'openIges', 'openParasolid', 'openProE', 'openStep', 'openVda', 'optimizationProcesses',
'pathName', 'save', 'saveAs', 'setValues', 'version']
For instance, the property pathName
before saving is
>>> mdb.pathName
'<unnamed>'
Saving the model database and checking the path:
>>> mdb.saveAs( pathName= 'mymdb1')
The model database has been saved to "C:\temp\works\mymdb1.cae".
>>> mdb.pathName
'C:\\temp\\works\\mymdb1.cae'