Screenshot capture in Batch Mode

Roshan Shiveshwar
Roshan Shiveshwar Altair Community Member
edited October 2020 in Community Q&A

Hi,

 

I have created a tcl script that captures screenshots (.jpg images) from Hypermesh screen. The script works fine when I execute it in interactive mode , but fails when I try it in batch mode.

So, is there any way to capture images in Batch mode?

 

API used in tcl script :  *jpegfilenamed 'Model_iso.jpg'

 

Command in .bat file : call  %ALTAIR_HOME_DIR%\hw14.0\hm\bin\win64\hmbatch.exe -b -tcl captureImages.tcl >> captureImages.log 2>&1

 

Thanks,

Roshan

Answers

  • tinh
    tinh Altair Community Member
    edited July 2017

    :unsure:/emoticons/default_unsure.png' title=':unsure:' />

    Maybe, no way.

    you are in batch mode that there is no GUI, how can you capture a GUI when you don't have it?

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2017

    but fails when I try it in batch mode.

    So, is there any way to capture images in Batch mode?

    What ever geometry cleaning, meshing works in the back ground and code does all this and there is no chance of graphics during the process. :wacko:/emoticons/default_wacko.png' title=':wacko:'>

     

    But I think something like this will be a added feature. ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20'>

  • tinh
    tinh Altair Community Member
    edited July 2017

    The temporary solution is do not run hmbatch.exe,

    if you just want to hide hypermesh window, at begining of your script, call withdraw command:

     wm withdraw . #your codes here... *jpegfilenamed Model_Iso.jpg #.... #stop: wm state . zoomed #or save file and quit: *writefile your_file.hm 1 exit

     

  • Roshan Shiveshwar
    Roshan Shiveshwar Altair Community Member
    edited July 2017

    Thanks tinh, Prakash.

     

    I was having the same thought. But, it will be really wonderful if we can somehow achieve it.  ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' /> 

     

     

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited July 2017

    In fact, when you make a screenshot, you catch whatever displayed in a screen, real or virtual. If you have not a 'screen', you can't do screen...shot, that's logic :-)