Recently I was asked if there was an easy way to run a command line python script from inside CAE and 'pick' a file to run it against - I guess some people don't like command prompts, or typing, or both?!
Anyway, I thought it was a nice enough example of getting started with the Really Simple GUI Dialog Builder that I'd share it.
The original script simply reads a .dat file and prints out the job time summary info, so using the command:
abaqus python datReader myyDatFileName.dat
returns something like this:
JOB TIME SUMMARY
USER TIME (SEC) = 0.10000
SYSTEM TIME (SEC) = 0.0000
TOTAL CPU TIME (SEC) = 0.10000
WALLCLOCK TIME (SEC) = 0
Simple enough. If you look in datReader.py (attached) you'll see it has a function readDat(datName) - I guess we need to pass it 'datName' then.
OK, let's fire up CAE and launch the Really Simple GUI Dialog Builder:
Now add a file selector and name the field 'datName' (to be passed to our function):
On the 'Kernel' tab, open the existing script and point it at the 'readDat' function:
If you go back to the 'GUI' tab and uncheck 'Show dialog in test mode' then you can test your fine handywork:
Easy as that. Just save and you're done.
The attached zip includes the completed plugin for reference. Its in RSG format, so you can open it in the RSG Dialog Builder and take a look.
