Custom Kernel#

The customKernel module augments the mdb, odb, and session objects with an object called customData. The customData object can contain custom data that you created using standard Python objects; for example, dictionaries, strings, numbers, and classes. In addition, the customData object can contain objects that you created using the classes described in this section.

All objects that you create under the mdb.customData and odb[odbName].customData object will be stored in the Abaqus/CAE model and output database, respectively, when you save the database; all objects that you create under the session.customData object will be lost when you exit Abaqus/CAE.

The customData object is an instance of the RepositorySupport class; for more information, see RepositorySupport. The classes described in this section register with the GUI infrastructure when you create the class. As a result, if you write a custom GUI script, you can query these objects from the GUI, and you can also be notified when the contents of these objects change so you can update the GUI accordingly. For more information, see Extending the Abaqus Scripting Interface and Accessing kernel data from the GUI.

Object features#

CommandRegister#

class CommandRegister[source]#

This class allows you to derive a general class that can be queried from the GUI and is capable of notifying the GUI when the contents of the class change.

Notes

This object can be accessed by:

import customKernel

RegisteredDictionary#

class RegisteredDictionary[source]#

This class allows you to create a dictionary that can be queried from the GUI and is capable of notifying the GUI when the contents of the dictionary change. The keys to a RegisteredDictionary must be either strings or integers. The RegisteredDictionary object is derived from the CommandRegister object.

Notes

This object can be accessed by:

import customKernel

Methods

Methods()

The RegisteredDictionary object supports the same methods as a Python dictionary.

changeKey(fromName, toName)

This method changes the name of a key in the dictionary.

Methods()[source]#

The RegisteredDictionary object supports the same methods as a Python dictionary. In addition, the RegisteredDictionary object supports the changeKey method.

changeKey(fromName: str, toName: str)[source]#

This method changes the name of a key in the dictionary.

Parameters:
fromName

A String or an integer specifying the name of the key to be changed.

toName

A String or an integer specifying the new name for the key.

RegisteredList#

class RegisteredList[source]#

This class allows you to create a list that can be queried from the GUI and is capable of notifying the GUI when the contents of the list change. The RegisteredList object is derived from the CommandRegister object.

Notes

This object can be accessed by:

import customKernel

Methods

Methods()

The RegisteredList object supports the same methods as a standard Python list object.

Methods()[source]#

The RegisteredList object supports the same methods as a standard Python list object.

RegisteredTuple#

class RegisteredTuple(tuple: tuple)[source]#

This class allows you to create a tuple that can be queried from the GUI and is capable of notifying the GUI when the contents of any of the tuple’s members change. The RegisteredTuple object is derived from the CommandRegister object.

Notes

This object can be accessed by:

import customKernel

Methods

Methods()

The RegisteredTuple object supports the same methods as a standard Python list object.

Methods()[source]#

The RegisteredTuple object supports the same methods as a standard Python list object.

RepositorySupport#

class RepositorySupport[source]#

The RepositorySupport is a base class from which you can derive your own classes that are designed to contain custom repositories. Instances of this class can be queried from the GUI and are capable of notifying the GUI when the contents of the instance change. The RepositorySupport object is derived from the CommandRegister object.

Notes

This object can be accessed by:

import customKernel
mdb.customData
session.customData
session.odbs[name].customData

Methods

Repository(name, constructors)

This method installs a repository on the class.

Repository(name: str, constructors: str)[source]#

This method installs a repository on the class. The repository is an instance of a RegisteredDictionary class. Refer to RegisteredDictionary for details on its methods. The objects stored in the repository are assumed to have an attribute called name that stores the key used to access the object in the repository. The name attribute will be modified by the changeKey method.

Parameters:
name

A String specifying the name of the repository.

constructors

A constructor or sequence of constructors specifying which classes will store their instances in the repository.