Capture Screenshot in HyperMesh
Hello,
Complete newbie here.
I am trying to highlight a few elements and capture screenshot in HyperMesh.
This is the code I have put together by referring to command.cmf file:
*unmaskall()
*createmark(systems,1) 'all'
*maskentitymark(systems,1,0)
*createmark(elements,1) 101 102 103 104
*maskentitymark(elements,1,0)
*maskreverse(elements)
*createmark(elements,1) 101 102 103 104
*numbersmark(elements,1,1)
*window(0,0,0,0,0)
after 500
*jpegfilenamed 'Capture.jpg'
Everything works as expected except for the last command to save screenshot. Interestingly, if I give this last command separately in the command window, it works fine.
Any ideas?
Thanks,
Ayush
Answers
-
try removing quotes around Capture.jpg
try this:
*jpegfilenamed Capture.jpg
0 -
Still doesn't work.
I tried hm_windowtofile as well. It has the same issue. Works from command window, but doesn't work as part of the script.
I am using HM11, if that's relevant.
0 -
What is error msg ?
0 -
Altair Forum User said:
Hello,
Complete newbie here.
I am trying to highlight a few elements and capture screenshot in HyperMesh.
This is the code I have put together by referring to command.cmf file:
*unmaskall()
*createmark(systems,1) 'all'
*maskentitymark(systems,1,0)
*createmark(elements,1) 101 102 103 104
*maskentitymark(elements,1,0)
*maskreverse(elements)
*createmark(elements,1) 101 102 103 104
*numbersmark(elements,1,1)
*window(0,0,0,0,0)
after 500
*jpegfilenamed 'Capture.jpg'Everything works as expected except for the last command to save screenshot. Interestingly, if I give this last command separately in the command window, it works fine.
Any ideas?
Thanks,
Ayush
Hi @Ayush01
are you directly writing this code inside userpage file?
if so change the line to
*jpegfilenamed(Capture.jpg)
0 -
Altair Forum User said:
Hi @Ayush01
are you directly writing this code inside userpage file?
if so change the line to
*jpegfilenamed(Capture.jpg)
@vipin: Noooooooooo, it's WRONG!
@Ayush01: Try fullpath for JPG file, something like 'C:/Temp/capture.jpg' instead of 'capture.jpg'. It works for my script.
0 -
@Q.Nguyen-Dai yes it works for .tcl file, but i am not sure in what format he has written.
if it is .mac file we have to write it inside brackets ().
0 -
I was saving it in a .cmf file.
I got it working now with the following code, and tcl format:
*unmaskall
*createmark systems 1 'all'
*maskentitymark systems 1 0
*createmark elements 1 101 102 103 104
*maskentitymark elements 1 0
*maskreverse elements
*createmark elements 1 101 102 103 104
*numbersmark elements 1 1
*window 0 0 0 0 0
*jpegfilenamed /Capture.jpgThank you for suggestions.
0 -
In your script, you could :
- Detect the current folder where's found your HM model and save your picture into this folder.
- Make automatical increment number into picture file name, so you have 'Capture_001.jpg', 'Capture_002.jpg', 'Capture_003.jpg',....etc
0