To manage macros containing a set of Abaqus Scripting Interface commands, select FileMacro Manager from the main menu bar. When you create a macro, Abaqus/CAE records a sequence of Abaqus Scripting Interface commands in a macro file while you interact with Abaqus/CAE. Each command corresponds to an interaction with Abaqus/CAE, and replaying the macro reproduces the sequence of interactions.
Macros are stored in a file called abaqusMacros.py. Abaqus/CAE searches three directories for abaqusMacros.py, in the following order:
The site directory of the Abaqus installation.
Your home directory.
The current working directory.
Your macro will run only in the same context in which it was recorded. For example, if you create a macro that copies a part named gear1 to a new part named gear2, the macro will be executed in a new Abaqus/CAE session only if a part named gear1 exists.
The Abaqus Scripting Interface commands are stored in ASCII text. You can edit abaqusMacros.py with a standard text editor; however, any errors that you introduce into the file will prevent the Macro Manager from displaying. For more information on commands, see the Abaqus Scripting User's Guide.
Tip: If you edit any of the abaqusMacros.py files using a text editor, you can click Reload from the buttons at the bottom of the Macro Manager to update the macro list without closing the manager.
To create a macro:
From the main menu bar, select FileMacro Manager.
The Macro Manager dialog box appears.
From the buttons across the bottom of the Macro Manager dialog box, click Create.
Enter a name for the macro in the Create Macro dialog box that appears, and click Continue. You cannot overwrite an existing macro.
Each of your interactions with Abaqus/CAE is stored as a command in the abaqusMacros.py file. A Recording macro dialog box appears to remind you the macro is recording. In addition, the Create, Delete, Run, and Reload buttons are not available in the Macro Manager while the macro is recording.
Click the Stop recording button to save the macro in abaqusMacros.py.
Abaqus/CAE updates the macro list in the Macro Manager.
To delete a macro:
From the main menu bar, select FileMacro Manager.
The Macro Manager dialog box appears.
Select the macro to delete. You can select more than one macro.
From the buttons across the bottom of the Macro Manager dialog box, click Delete.
From the dialog box that appears, click OK to confirm your action.
Abaqus/CAE deletes the macro from abaqusMacros.py and updates the macro list in the Macro Manager. You cannot recover a deleted macro.
To run a macro:
From the main menu bar, select FileMacro Manager.
The Macro Manager dialog box appears.
Select the macro to run.
From the buttons across the bottom of the Macro Manager dialog box, click Run. You can run only one macro; the Run button is not available if you selected more than one macro.
Abaqus/CAE runs the commands in the selected macro and displays a message in the message area when the macro execution completes.