Is it possible to create HyperMesh model (*.hm) using hmbatch.exe

Vladimir_Gantovnik
Vladimir_Gantovnik Altair Community Member
edited May 2023 in Community Q&A

Guys, is it possible to create HyperMesh model (*.hm) using hmbatch.exe (or something else) without open HyperMesh GUI?

For example, I want to create two nodes and save the model as model.hm using the following tcl script:

*createnode 0 0 0 0 0 0 *createnode 10 0 0 0 0 0 set path_hm "C:/projects/example1/nodes.hm" *writefile $path_hm 1

I don't want the HyperMesh main window to open.

Thank you!

Best Answer

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited May 2023 Answer ✓

    Adriano, so what should I do in order create a node in batch mode? Possible? If yes, please, show the example of the batch command.

    I can run tcl scripts using this command:

    "C:/Program Files/Altair/2021.2/hwdesktop/hm/bin/win64/hmbatch.exe" -tcl "D:/projects/example1/my_script.tcl"

    But if I add any commands from HyperMesh API it will not work, because as you said they are not supported by hmbatch. What should we do?

    Just did this, by running this command line:

    "C:\Program Files\Altair\2022.2\hwdesktop\hm\bin\win64\hmbatch.exe" -tcl "C:\_RUNNING\COMMUNITY\SCRIPT_HMBATCH\myscript.tcl"

     

    Using the attached script, with some tiny modifications.

     

    image

Answers

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

    yes, this is possible. The steps are exactly what you have mentioned.

    The only thing to worry is that a couple commands (iinterface commands) are not supported by hmbatch.

     

  • Vladimir_Gantovnik
    Vladimir_Gantovnik Altair Community Member
    edited May 2023

    yes, this is possible. The steps are exactly what you have mentioned.

    The only thing to worry is that a couple commands (iinterface commands) are not supported by hmbatch.

     

    Adriano, so what should I do in order create a node in batch mode? Possible? If yes, please, show the example of the batch command.

    I can run tcl scripts using this command:

    "C:/Program Files/Altair/2021.2/hwdesktop/hm/bin/win64/hmbatch.exe" -tcl "D:/projects/example1/my_script.tcl"

    But if I add any commands from HyperMesh API it will not work, because as you said they are not supported by hmbatch. What should we do?

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited May 2023 Answer ✓

    Adriano, so what should I do in order create a node in batch mode? Possible? If yes, please, show the example of the batch command.

    I can run tcl scripts using this command:

    "C:/Program Files/Altair/2021.2/hwdesktop/hm/bin/win64/hmbatch.exe" -tcl "D:/projects/example1/my_script.tcl"

    But if I add any commands from HyperMesh API it will not work, because as you said they are not supported by hmbatch. What should we do?

    Just did this, by running this command line:

    "C:\Program Files\Altair\2022.2\hwdesktop\hm\bin\win64\hmbatch.exe" -tcl "C:\_RUNNING\COMMUNITY\SCRIPT_HMBATCH\myscript.tcl"

     

    Using the attached script, with some tiny modifications.

     

    image

  • Vladimir_Gantovnik
    Vladimir_Gantovnik Altair Community Member
    edited May 2023

    Just did this, by running this command line:

    "C:\Program Files\Altair\2022.2\hwdesktop\hm\bin\win64\hmbatch.exe" -tcl "C:\_RUNNING\COMMUNITY\SCRIPT_HMBATCH\myscript.tcl"

     

    Using the attached script, with some tiny modifications.

     

    image

    Interesting!.... Does it generate correct hm file? Because this message "HM exiting with code 1" is better to be "HM exiting with code 0". I will try now. 

  • Vladimir_Gantovnik
    Vladimir_Gantovnik Altair Community Member
    edited May 2023

    Just did this, by running this command line:

    "C:\Program Files\Altair\2022.2\hwdesktop\hm\bin\win64\hmbatch.exe" -tcl "C:\_RUNNING\COMMUNITY\SCRIPT_HMBATCH\myscript.tcl"

     

    Using the attached script, with some tiny modifications.

     

    image

    Wow, it works. I got two nodes without GUI. This gives me incredible opportunities... Level "God"!