I have a result.frd file containing the finite element results. I want to programmatically take screenshots of the von Mises stress at different views like this:
Top.
Bottom.
Left.
Right.
Front.
Back.
I want to have a max zoom. I mean, the screenshots are preferred to be auto-filled. For example, the final screenshots would look like this:
Question
Is it possible to do it programmatically by CGX or PrePoMax? I mean by running their executables and passing some arguments?
Yes. Write a CGX input file like this (e.g. pictures.fbd):
# Change file name to the job name you used.
read result.frd
# Data set number depends on how may things you saved!
ds 4 e 7
rot y
frame
hcpy png right
rot r 90
frame
hcpy png front
rot r 90
frame
hcpy png left
rot r 90
frame
hcpy png back
rot y
rot u 90
frame
hcpy png top
rot d 180
frame
hcpy png bottom
quit
Thanks. Your script is a great point for me to start.
I adjusted this line:
# Data set number depends on how many things you saved!
ds 2 e 7
Error with CGX 2.10
I’m receiving this error with CGX version 2.10 on a Windows machine:
key:HARDCOPY from string hardcopy png bottom not known
key:QUIT from string quit not known
done
CGX 2.19
With CGX 2.19 the rotations are great. I can see that all 6 views are properly rotated But for some reason the final PNG files are not saved, along with this error:
key:HARDCOPY from string hardcopy png bottom not known
key:QUIT from string quit not known
I couldn’t find the latest version of CGX yet for Windows OS. If I find them, or if I build them, I will test them. Maybe the HARDCOPY and QUIT keywords of the script are available on the latest version of CGX
Finally, using hcpy command and installing ImageMagick along with its legacy utilities like convert.exe, composite.exe, etc. created the PNGs I wanted:
I will study CGX documentation further. Maybe I can also control what sections of the legend and color spectrum are displayed and so on. But for now, it’s great
For some reason, the exit, quit, q, and terminate commands don’t work. I’m studying the documentation to see how to terminate the FBD script and to close the accompanying CGX window