SAVING DISPLAY OPTIONS & CREATING DISPLAY TEMPLATES IN ABAQUS VIEWER
Written by Adarsh Bavani Shankar.
Abaqus Viewer/Visualization module is a powerful post processing tool which has unique features seldom used.
Users new to Abaqus Viewer might question if there is a good way to save the customized display options so that they don’t need to redo it again and again for future Abaqus sessions. Yes, Abaqus has an option to save the display settings through a gpr file. The file naming syntax is abaqus_vx.xx.gpr. Here, x.xx represents the Abaqus version in which the .gpr file was created. If Abaqus version 6.12 was used to create the .gpr file, then the file name would look like abaqus_v6.12.gpr.
TYPES OF DISPLAY OPTIONS SETTINGS THAT CAN BE SAVED
Listed below are a few examples of display option settings that can be saved in a gpr file.
- X-Y plot, X-Y report options and field report.
- Viewport annotation options and Graphics option.
- Animation options in Visualization module.
- Display of mesh, element and node labels.
- Print options.
STEPS TO CREATE A GPR FILE
After the display options are customized from the main menu bar, select FileSave >Display > Options to save all the current display options settings.
The Save Display Options dialog box pops up and provides you the option to save either in the current directory or in the home directory.
The current directory option stores the .gpr file in the current working directory. In addition, it also propagates the display settings to all the .odb files present in the current working directory.
The home directory option stores the .gpr file to the user’s home directory and the display settings propagates to all the .odb files opened in that particular Abaqus version, in this case version 6.12.
CURRENT WORKING DIRECTORY
EXAMPLE
Let’s assume that you want to change the legend font size from the default 8 to18 and save it in a gpr file. Figure 1 shows the odb file of bolted pipe flange analysis.
Navigate to the “Viewport Annotation Options…” as shown in the Figure 2. Click on the legend tab and press “Set Font…” button. Select font dialog box opens up. Change the size from 8 to 18. The legend font size is changed as shown in the Figure 4. Repeat the same procedure for title block or near the bottom of the current Select Font window you can check other areas to apply these same changes such as the Triad, Title block, and State block.
Save the display options to create a .gpr file (Figure 5). For detailed information follow the ‘steps to create a gpr file’ in page 1.
Close the Abaqus viewer and open the same odb file to see the legend font size to be 18.
FIGURE 1
FIGURE 2
FIGURE 3
FIGURE 4
FIUGRE 5
CREATING DISPLAY TEMPLATE
I have come across questions if a legend template or any custom display template can be created so that it can be loaded for any odb file without creating a .gpr file. Although there is no direct way to create a display template in Abaqus viewer, this can be easily accomplished using a python script. You don’t need to know python scripting to create one.
If you are not familiar with the syntax for the python scripts required for the legend template, they can be copied from the abaqus.rpy file created in the working directory. Abaqus.rpy files are basically replay files where every operation performed in Abaqus/CAE is recorded automatically in the form of Abaqus commands.
For an example, when you changed the legend font size from 8 to 18, the operation gets recorded in the replay file as
session.viewports['Viewport: 1'].viewportAnnotationOptions.setValues(
legendFont='-*-verdana-medium-r-normal-*-*-180-*-*-p-*-*-*')
All you have to do is to copy these two lines in a new notepad file as save it with an py extension as filename.py.
Then when you open the .odb file next time, you can run the python file using FileRun Script.
Attached is a sample python file, demo.py created by performing the operations in Viewer and then copying from a abaqus.rpy file. The python file changes the legend font size to 18, changes the maximum value in the legend to 300, minimum value to 0 and the number of intervals to 6.
BEFORE USING THE PYTHON SCRIPT
AFTER USING THE PYTHON SCRIPT
