Request for availability of script of extracting Mode Shapes from HyperView in .gif format

Unknown
edited August 2022 in Community Q&A

I would like to enquire if there is any script available to extract multiple modes shapes (in .gif format) of modal analysis.

 

Lets say I have to extract first 10 mode shapes from HyperView for my FEA report generation, I am interested in such script to do that. Save all those gifs at any specified folder, so that I can use it.

Best Answer

Answers

  • PaulAltair
    PaulAltair
    Altair Employee
    edited May 2022 Answer ✓

    MVP Toolbar (available here: https://web2.altairhyperworks.com/hubfs/MVP_Toolbar.zip)

    has this for avi, it may be possible to modify the tcl to write gif instead

    image

  • PaulAltair
    PaulAltair
    Altair Employee
    edited May 2022

    MVP Toolbar (available here: https://web2.altairhyperworks.com/hubfs/MVP_Toolbar.zip)

    has this for avi, it may be possible to modify the tcl to write gif instead

    image

    Attached is modified version of the modal export tool from MVP toolbar, now it writes gifs instead of AVI

     

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited May 2022

    You can also use the brand new HWC commands that makes automation in HyperView much easier.

    Take a look at the attached video.

     

    The script would be something like this:

    #open model
    hwc open animation modelandresult D:/BR_LAP52/ADRIANO/MODELOS_BASICOS/MODAL_CONTATO/Modal_CONTATO.h3d D:/BR_LAP52/ADRIANO/MODELOS_BASICOS/MODAL_CONTATO/Modal_CONTATO.h3d

    #load result and legend
    hwc result scalar load type="Eigen Mode"
    hwc show legends

    for {set i 1} {$i <= 3} {incr i} {

        #contouring mode #i
        hwc result simulation $i

        #capturing GIF for mode i
        hwc save animation page D:/BR_LAP52/ADRIANO/MODELOS_BASICOS/MODAL_CONTATO/mode_${i}.gif

    }

  • Akshay Manthekar
    Akshay Manthekar Altair Community Member
    edited June 2022

    Hey Adriano,
    The video was very good and explanatory. I want to know if HWC command panel is available for HyperView 2017.3 also?

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited June 2022

    Hey Adriano,
    The video was very good and explanatory. I want to know if HWC command panel is available for HyperView 2017.3 also?

    no. HWC was introduced in 2020.x or 2021, I guess.

    Before that you will need to go into TCL scripting.

  • Leon_21463
    Leon_21463 Altair Community Member
    edited August 2022

    Hey Adriano,

    your comments where quite useful. I wonder however, if there is the possibility to to loop through each mode with the suggested for-loop.Something like:

    ...

    for {set i 1} {$i <= 3} {incr i} {

        #contouring mode #i
        hwc result mode $i

        #capturing GIF for mode i

    ...

    The only option  I found in the HWC command documentation is the result subcase <id> command. This only recognizes my Subcase 1 (Normal_Modes) and only displays the Mode 1. I can't find a way to acces any other mode via TCL commands e.g. Mode 2, Mode 3 ... .

    Does anyone know a solution for that?

    Thanks a lot!

    Leon

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited August 2022

    Hey Adriano,

    your comments where quite useful. I wonder however, if there is the possibility to to loop through each mode with the suggested for-loop.Something like:

    ...

    for {set i 1} {$i <= 3} {incr i} {

        #contouring mode #i
        hwc result mode $i

        #capturing GIF for mode i

    ...

    The only option  I found in the HWC command documentation is the result subcase <id> command. This only recognizes my Subcase 1 (Normal_Modes) and only displays the Mode 1. I can't find a way to acces any other mode via TCL commands e.g. Mode 2, Mode 3 ... .

    Does anyone know a solution for that?

    Thanks a lot!

    Leon

    in HV, your mode is the 'simulation'.

     

    for {set i 1} {$i <= 3} {incr i} {

        #contouring mode #i
        hwc result simulation $i

        #capturing GIF for mode i
        hwc save animation page D:/BR_LAP52/ADRIANO/MODELOS_BASICOS/MODAL_CONTATO/mode_${i}.gif

    }

  • Leon_21463
    Leon_21463 Altair Community Member
    edited August 2022

    in HV, your mode is the 'simulation'.

     

    for {set i 1} {$i <= 3} {incr i} {

        #contouring mode #i
        hwc result simulation $i

        #capturing GIF for mode i
        hwc save animation page D:/BR_LAP52/ADRIANO/MODELOS_BASICOS/MODAL_CONTATO/mode_${i}.gif

    }

    Might it be, that you are working with Hyperworks 2021.2... because when I run the scrip with Hyperworks 2021.1 I get the same gif (of the first mode) exported muliple times as if Hyperworks does not differenciate between Simulation 1 and 2.

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited August 2022

    Might it be, that you are working with Hyperworks 2021.2... because when I run the scrip with Hyperworks 2021.1 I get the same gif (of the first mode) exported muliple times as if Hyperworks does not differenciate between Simulation 1 and 2.

    What solver are you using?

    If this is OptiStruct, the behavior should be like mentioned before.

    But maybe you're using another solver, so that the result file is written differently.

     

    Just launch HW Console, and perform the same operation manually, changing the mode number from one to another.

    This will write the command in the HW Console, and then you can use the same command. (of course, adjusting it to be parametrically changed in your 'for' loop.

  • Leon_21463
    Leon_21463 Altair Community Member
    edited August 2022

    What solver are you using?

    If this is OptiStruct, the behavior should be like mentioned before.

    But maybe you're using another solver, so that the result file is written differently.

     

    Just launch HW Console, and perform the same operation manually, changing the mode number from one to another.

    This will write the command in the HW Console, and then you can use the same command. (of course, adjusting it to be parametrically changed in your 'for' loop.

    Hi Adriano,

    I am also running OptiStruct.

    I launched the HW Console, and found, that changing the mode manually leads to the command 'animate frame <id>' in the console. So I get 'animate frame 2' for the second mode and 'animate frame 3' for the third mode. 

    When I type in this command however, it does what it actually should do and jump to the defined frame in <id>. So I don't know why I get this command written in HW Console when changing the mode.

    When I use the command 'result simulation 1' I get an error message about the syntax. (see the image attached)

    Thank you very much again.

    image