Object-oriented programming and the Abaqus Scripting Interface—a summary

After you create an object, you then use methods of the objects to enter or to modify the data associated with the object. For example, you use the addNodes and addElements methods of the Part object to add nodes and elements, respectively. Similarly, you use the addData method of the FieldOutput object to add field output data.

The following list summarizes some of the concepts behind object-oriented programming and how they relate to the Abaqus Scripting Interface:

  • An object encapsulates some data and functions that are used to manipulate those data.

  • The data encapsulated by an object are called the members of the object.

  • The functions that manipulate the data are called methods.

  • The Abaqus Scripting Interface uses the convention that the name of a type of object begins with an uppercase character; for example, a Viewport object.

  • A method that creates an object is called a constructor. The Abaqus Scripting Interface uses the convention that constructors begin with an uppercase character. In contrast, methods that operate on an object begin with a lowercase character.

  • After you create an object, you then use methods of the object to enter or to modify the data associated with the object. For example, if you are creating an output database, you first create an Odb object. You then use the addNodes and addElements methods of the Part object to add nodes and elements, respectively. Similarly, you use the addData method of the FieldOutput object to add field output data to the output database.

  • You use the Access description provided with each object in the Abaqus Scripting Reference Guide to determine how you access the object. You append a method or a member to this description when you are writing a script.

  • You use the Path description provided with each constructor in the Abaqus Scripting Reference Guide to determine the path to the constructor.

  • You use the setValues() method to modify the members of an Abaqus Scripting Interface object.

    session.viewports['Side view'].setValues(origin=(20,20))