Figure 21 illustrates how ABAQUS Scripting Interface commands interact with the ABAQUS/CAE kernel.
ABAQUS Scripting Interface commands can be issued to the ABAQUS/CAE kernel from one of the following:The graphical user interface (GUI). For example, when you click OK or Apply in a dialog box, the GUI generates a command based on your options and settings in the dialog box. You can use the Macro Manager to record a sequence of the generated ABAQUS Scripting Interface commands in a macro file. For more information, see Creating and running a macro, Section 9.5.5 of the ABAQUS/CAE User's Manual.
Click in the lower left corner of the main window to display the command line interface (CLI). You can type a single command or paste in a sequence of commands from another window; the command is executed when you press [Enter]. You can type any Python command into the command line; for example, you can use the command line as a simple calculator.
Note: When you are using ABAQUS/CAE, errors and messages are posted into the message area. Click in the lower left corner of the main window to display the message area.
If you have more than a few commands to execute or if you are repeatedly executing the same commands, it may be more convenient to store the set of statements in a file called a script. A script contains a sequence of Python statements stored in plain ASCII format. For example, you might create a script that opens an output database, displays a contour plot of a selected variable, customizes the legend of the contour plot, and prints the resulting image on a local PostScript printer.
You can use one of the following methods to run a script:
Running a script when you start ABAQUS/CAE
You can run an ABAQUS/CAE script when you start a session by typing the following command:
abaqus cae script=myscript.pywhere myscript.py is the name of the file containing the script. The equivalent command for ABAQUS/Viewer is
abaqus viewer script=myscript.py
Scripts are useful for starting ABAQUS/CAE in a predetermined state. For example, you can define a standard configuration for printing, create remote queues, and define a set of standard materials and their properties.
Running a script without the ABAQUS/CAE GUI
You can run a script without the ABAQUS/CAE GUI by typing the following command:
abaqus cae noGUI=myscript.pywhere myscript.py is the name of the file containing the script. The equivalent command for ABAQUS/Viewer is
abaqus viewer noGUI=myscript.py
The ABAQUS/CAE kernel is started without the GUI. Running a script without the ABAQUS/CAE GUI is useful for automating pre- or postanalysis processing tasks without the added expense of running a display. When the script finishes running, the ABAQUS/CAE kernel terminates. If you execute a script without the GUI, the script cannot interact with the user, monitor jobs, or generate animations.
Running a script from the startup screen
When you start an ABAQUS/CAE session, ABAQUS displays the startup screen. You can run a script from the startup screen by clicking Run Script. ABAQUS displays the Run Script dialog box, and you select the file containing the script.
Running a script from the File menu
You can run a script by selecting FileRun Script from the main menu bar. ABAQUS displays the Run Script dialog box, and you select the file containing the script.
Running a script from the command line interface
You can run a script from the command line interface (CLI) by typing the following command:
execfile('myscript.py')where myscript.py is the name of the file containing the script and the file in this example is in the current directory. Figure 22 shows an example script being run from the command line interface.Click in the lower left corner of the main window to switch from the message area to the command line interface.