Jose Thomas
Jose Thomas

Reputation: 1

Python Code to Automate Abaqus Run Script

Error with Subprocess addition This is the error I get regarding the abaqus module

I'm quite new to python and so please don't mind if this question might seem silly.

So I have python file that does the function of opening an abaqus viewer and I have another python file that describes the functions I want to do in the abaqus viewer.

I need a piece of code that can automate the second script without me having to manually go into file>run script.

Script to Open Abaqus:

import os
import subprocess

os.startfile('Q:/win_apps/scripts/simulia/Abaqus/6.14-3/Use_these_if_not_working/abq6143_viewer.bat')

And then I have a python script that has the code regarding my output requests from abaqus viewer.

What line can I add to the above file to automatically take the second python script and run it?

Upvotes: 0

Views: 2596

Answers (1)

brady
brady

Reputation: 2257

When running Abaqus with the typical start up scripts you can pass Abaqus/Viewer a script to run from the command line:

abq6143 viewer noGUI=script.py

where you replace script.py with the name of your Python script. This will start up Abaqus/Viewer with no user interface, run the script, and then quit.

If you want the user interface to come up and automatically run your script you can use the script= command instead of noGUI:

abq6143 viewer script=script.py

I see that you're using a custom batch file to start up Abaqus/Viewer. Without seeing those contents I couldn't say exactly how you would integrate the above, but you will probably need to adjust the relevant line in the batch file with the noGUI or script command.

Upvotes: 1

Related Questions