Every application is started from a short startup script. The startup script performs the following tasks:
Initializes an application object. The application object is responsible for high-level functions, such as managing message queues and timers and updating the GUI, and controlling the main window. It is not a visible object.
Instantiates a main window. The main window is what the user sees when the application is first started and provides access to all of the application’s functionality.
Creates and runs the application. Once the application is run, it enters an event loop where it waits to react to user input, such as the click of a mouse.
The following illustrates a typical startup script.
Note: You can download this script and the files associated with it; for example, caeMainWindow.py, from the ABAQUS Process Automation Portal.
from abaqusGui import AFXApp import sys from caeMainWindow import CaeMainWindow # Initialize the application object # app = AFXApp('ABAQUS/CAE', 'ABAQUS Inc.') app.init(sys.argv) # Construct the main window # CaeMainWindow(app) # Create the application and run it # app.create() app.run()The first statement in the script imports the AFXApp constructor from the abaqusGui module, which contains access to the entire ABAQUS GUI Toolkit. The sys module is also imported since it is needed to pass arguments into the application’s init method. After the script imports the sys module, it imports the main window constructor.
The next statements instantiate and initialize the application object. The application object is discussed in more detail in The application object, Section 12.1. The script then instantiates the main window. The main window is what the user will see when the application is started. The main window is discussed in more detail in Chapter 13, The main window.”
The application constructor creates all the data structures needed for that object, and the app.create() statement creates all the GUI windows required by the application object. The app.run() statement displays the application and then enters an event loop. The event loop then waits for user interaction.
If you want to post your own dialog box when your application starts, you can add the following statements to your startup script. The statements should appear just before the last line of the script.
from myStartupDB import MyStartupDB db = MyStartupDB() db.create() db.showModal()When you start your custom application, you should use the –noStartup option in the ABAQUS/CAE execution procedure to prevent ABAQUS/CAE from posting its own startup dialog. For more information, see Execution procedure for ABAQUS/CAE, Section 3.2.3 of the ABAQUS Analysis User's Manual.