Access

The description of each object in the Abaqus Scripting Reference Guide begins with a section that describes how you access an instance of the object. The import statements are provided for completeness. Abaqus/CAE imports all modules when you start a session, and you do not need to include the import module name statement in your scripts. However, you must import the Abaqus Scripting Interface Symbolic Constants with the following statement:

from abaqusConstants import *
These should be the first statement in all your Abaqus Scripting Interface scripts.

The following is the access description for the Material object:

import material
mdb.models[name].materials[name]

The first line of the access description indicates the module that Abaqus/CAE imported to make this object, and its methods and members, available to your script.

The access description also specifies where instances of the object are located in the data model. In the previous example the second line indicates how your script can access Material objects from a particular model. You must qualify a material object, command, or member with the variable mdb, as described in Functions and modules. For example,

mdb.models[crash].Material[steel]
mdb.models[crash].materials[steel].Elastic(
    table=((30000000.0, 0.3), ))
elasticityType = mdb.models[crash].materials[steel].elastic.type

Similarly, if you are reading from an output database, the following is the access description for the HistoryRegion object:

import odbAccess
session.odbs[name].steps[name].historyRegions[name]

The first line indicates that Abaqus/CAE imported the odbAccess module to make the Odb objects, methods, and members available to your Abaqus Scripting Interface script. The second line indicates how your script can access HistoryRegion objects from a particular step.

The Access description for the FieldOutput object is

session.odbs[name].steps[name].frames[i].fieldOutputs[name]

The following statements show how you use the object described by this Access description:

sideLoadStep = session.odbs['Forming loads'].steps['Side load']
lastFrame = sideLoadStep.frames[-1]
stressData = lastFrame.fieldOutputs['S']
integrationPointData = stressData.getSubset(
    position=INTEGRATION_POINT)
invariantsData = stressData.validInvariants
  • The next to last line shows the getSubset method of the FieldOutput object.

  • The last line shows the validInvariants member of the FieldOutput object.