🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Capture Screenshot in HyperMesh

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

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

Find more posts tagged with

Sort by:
1 - 8 of 81
    User: "Pandurang"
    Altair Community Member
    Updated by Pandurang

    try removing quotes around Capture.jpg

     

    try this:

     

    *jpegfilenamed Capture.jpg

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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.

    User: "Pandurang"
    Altair Community Member
    Updated by Pandurang

    What is error msg ?

    User: "vipin_22401"
    Altair Community Member
    Updated by vipin_22401

    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)

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

     

    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.

    User: "vipin_22401"
    Altair Community Member
    Updated by vipin_22401

    @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 ().

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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 D:/Capture.jpg

     

    Thank you for suggestions.

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    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