HyperMesh 14.0 Auto Save Script

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hi, has anyone got an autosave script (or some other way of doing this) for HM14.0?

 

I would love a script that would, lets say, save every hour automatically to a new sequenced version of the file.

 

Thanks for any help.

 

Richard.

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2017

    Hi Richard,

     

    There is no option for now to autosave HM files at regular interval, Maybe you can write a code to run a tcl script which autosaves session/hm file at regular intervals

     

    There is a a command called *setautosaveinterval(#) but this won't work for HyperMesh application.

  • tinh
    tinh Altair Community Member
    edited January 2017

    Hi, I see an available script. To use it, type command

    source [file join [hm_info -appinfo SPECIFIEDPATH hm_scripts_dir] autosave.tcl]

    autosave::CreateDialog

     

    or you can make a simple script:

     proc ::myautosave minutes {      catch {           file rename [hm_info currentfile] [hm_info currentfile].[clock seconds]           ::HM_Framework::p_SaveFile      }      uplevel #0 [list after [expr $minutes*60000] [list ::myautosave $minutes]] }

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2017

    All,

     

    One can try below method.

    <?xml version="1.0" encoding="UTF-8"?>AutoSave.PNG

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited November 2020

    I have small script to save current model into new file under the form <model_name>_YYYYMMDD_HHMM.hm

    Just assigned this script to keyboard shortcut Ctrl-S for example (see image).

     

    <?xml version="1.0" encoding="UTF-8"?>HM_Key-Command_Mappings.png

    Unable to find an attachment - read this blog

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2019

    Hi, I see an available script. To use it, type command

    source [file join [hm_info -appinfo SPECIFIEDPATH hm_scripts_dir] autosave.tcl]

    autosave::CreateDialog

     

    or you can make a simple script:

      proc ::myautosave minutes {      catch {           file rename [hm_info currentfile] [hm_info currentfile].[clock seconds]           ::HM_Framework::p_SaveFile      }      uplevel #0 [list after [expr $minutes*60000] [list ::myautosave $minutes]] }

     

    Mr. Tinh,

     

    How you had learned the TCL/TK?  Whether you had learned on your own by watching the tutorials?

     

    Sorry for disturbing you with this type of questions. Why am asking this question to you is , I want to know how experts were learned this language.

     

    Awaiting for your reply Mr. Tinh.

     

    Regards,

    Saravanan R

  • tinh
    tinh Altair Community Member
    edited March 2019

    Actually i am not a tcl expert - it is used widely. I learned hypermesh before tcl. Once you're familiar with most hypermesh features, scripting is not a problem because hypermesh outputs every action of you, pick each command from command.cmf file, look it up in hm reference guide, do examples given by altair.

    Tcl features are listed in manual (activestate.com) similar to other languages. This is the most simple syntax language I ever know and much easier than pascal.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2019

    Actually i am not a tcl expert - it is used widely. I learned hypermesh before tcl. Once you're familiar with most hypermesh features, scripting is not a problem because hypermesh outputs every action of you, pick each command from command.cmf file, look it up in hm reference guide, do examples given by altair.

    Tcl features are listed in manual (activestate.com) similar to other languages. This is the most simple syntax language I ever know and much easier than pascal.

    Thanks Mr. tinh, this one really helps me.

  • Dinesh c
    Dinesh c Altair Community Member
    edited July 2019

    All,

     

    One can try below method.

    <?xml version="1.0" encoding="UTF-8"?>AutoSave.PNG

    Thank you so much. very helpful this screenshot.

  • Pgocer95
    Pgocer95 New Altair Community Member
    edited November 2020

    Mevcut modeli <model_name> _YYYYMMDD_HHMM.hm biçiminde yeni bir dosyaya kaydetmek için küçük bir komut dosyası var

    Ctrl-S klavye kısayoluna atadım (resme bakın).

     

    <?xml version="1.0" encoding="UTF-8"?>HM_Key-Command_Mappings.png

    Hi, hypermesh does not support tbc. I need TCL, can you share it with me?

    Unable to find an attachment - read this blog