Using the RepositorySupport class allows you to create a hierarchy of repositories; for example, in the Abaqus Scripting Interface the parts repository is a child of the models repository. The first argument passed into your constructor is stored as name; it is created automatically by the infrastructure. To create a hierarchy of repositories, derive your class from RepositorySupport and use its Repository method to create child repositories as shown below. The Repository method is described in Repositories. from abaqus import *
from customKernel import CommandRegister, RepositorySupport
class Block(CommandRegister):
def __init__(self, name):
CommandRegister.__init__(self)
class Model(RepositorySupport):
def __init__(self, name):
RepositorySupport.__init__(self)
self.Repository('blocks', Block)
mdb.customData.Repository('models', Model)
mdb.customData.Model('Model-1')
mdb.customData.models['Model-1'].Block('Block-1')
The path to the object being created can be found by calling repr(self) in the constructor of your object. | |||||||