6.9 Using ABAQUS Scripting Interface commands in your environment file

The ABAQUS environment file (abaqus_v6.env) is read by ABAQUS/CAE when you start a session. The environment file can contain ABAQUS Scripting Interface commands. The following is an example environment file:

scratch = 'c:/temp'
pre_memory = 3000000

def onCaeGraphicsStartup():

    # Graphics preferences
    #
    session.defaultGraphicsOptions.setValues(
        displayLists=OFF, dragMode=AS_IS)

def onCaeStartup():

    # Print preferences
    #
    session.printOptions.setValues(vpDecorations=OFF,
        vpBackground=OFF, rendition=COLOR,
        printCommand='lpr')
    session.psOptions.setValues(date=OFF)

    # Job preferences
    #
    def setJobPreferences(module, userData):
    
        import job
        session.Queue(name='long', hostName='server',
            queueName='large', directory='/tmp')
    addImportCallback('job', setJobPreferences)

    # Visualization preferences
    #
    def setVisPreferences(module, userData):
    
        import visualization
        session.defaultOdbDisplay.contourOptions.setValues(
            renderStyle=SHADED, visibleEdges=EXTERIOR,
            contourStyle=CONTINUOUS)
    addImportCallback('visualization', setVisPreferences)

The addImportCallback statement instructs ABAQUS to call a function when the user first imports a module. In this example ABAQUS calls the setJobPreferences function when the user first enters the Job module, and ABAQUS calls the setVisPreferences function when the user first enters the Visualization module. The setJobPreferences function creates a queue on a remote host. The setVisPreferences function sets default options for contour plots.

The example environment file uses the onCaeStartup() function to control a set of Python statements that are executed when ABAQUS/CAE first starts. The environment file can also contain the following:

The following variables are available to the onJobStartup() and onJobCompletion() functions:

id

The job identifier that was specified as the value of the job option from the command line.

savedir

The path to the directory from which the job was submitted.

scrdir

The path to the scratch directory.

analysisType

The type of analysis to be executed. Possible values are STANDARD and EXPLICIT.

For a list of the variables that are available outside of the onJobStartup() and onJobCompletion() functions, see Job variables, Section 4.1.9 of the ABAQUS Installation and Licensing Guide.

For more information on the environment file, see Using the ABAQUS environment settings, Section 3.4.1 of the ABAQUS Analysis User's Manual, and Chapter 4, Customizing the ABAQUS environment,” of the ABAQUS Installation and Licensing Guide.