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.

Other Classes

class CommandRegister[源代码]

基类:object

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.

备注

This object can be accessed by:

import customKernel

Member Details:

class RegisteredDictionary[源代码]

基类:CommandRegister, dict

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.

备注

This object can be accessed by:

import customKernel

Member Details:

Methods()[源代码]

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

In addition, the RegisteredDictionary object supports the changeKey method.

changeKey(fromName, toName)[源代码]

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

参数:
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.

class RegisteredList[源代码]

基类:CommandRegister, list

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.

备注

This object can be accessed by:

import customKernel

Member Details:

Methods()[源代码]

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

class RegisteredTuple(tuple)[源代码]

基类:CommandRegister, tuple

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.

备注

This object can be accessed by:

import customKernel

Member Details:

Methods()[源代码]

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

class RepositorySupport[源代码]

基类:CommandRegister

The 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.

备注

This object can be accessed by:

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

Member Details:

Repository(name, constructors)[源代码]

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.

参数:
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.