I have an abaqus python script I've been using for a parametric study. It is exhausting to go into the code and edit it every time I want to run different options. I'd like to be able to pass the script arguments so that I can run different options without needing to change the code.
I'd like to do something like this...
abaqus cae script='Script.py --verbose --data=someData.dat'
I've tried the above and I've also tried
abaqus python Script.py --verbose --data=someData.dat
With no success. Is this at all possible?
Good find Schickmeister. It was not clear to me how to implement, so here is an example
launch abaqus python in cmd.exe
abaqus cae noGUI
enter some python code
>>>import sys
>>>print sys.argv
['C:\\ABAQUS\\6.13-2SE\\code\\bin\\ABQcaeK.exe', '-cae', '-noGUI', '-lmlog', 'ON', '-tmpdir', 'C:\\Windows\\TEMP']
>>>quit()
See how many arguments show up? That's why we need to grab the last one now launch your python script with argument "test.odb"
abaqus cae noGUI=odb_to_video.py -- test.odb
and retrieve the last argument in your script with
odbname = sys.argv[-1]
myOdb = visualization.openOdb(path=odbname)
hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With