How can I get the name of the current model opened in Hypermesh?

Options
Thirukumaran Subbian
Thirukumaran Subbian
Altair Community Member
edited April 4 in Community Q&A

Hi,

I need the name of the current model imported in the Hypermesh to identify the model's file directory. I have tried using [hm_info currentfile], but it did not produce the output as expected. Is there any command which could be similar to that of this and which does not require panel interaction such as [hm_info hmfilename]. Any inputs with respect to TCL and HM commands would be much appreciated. 

Thanks in advance!

Tagged:

Best Answer

  • Adriano A. Koga_21570
    Adriano A. Koga_21570
    Altair Employee
    edited April 4 Answer ✓
    Options

    Try these:

     

    set currentmodel [hm_info currentfile]

    set modelname [file tail $currentmodel]

    set dirname [file dirname $currentmodel]

     

Answers

  • Rajashri Saha_20479
    Rajashri Saha_20479
    Altair Employee
    edited April 2
    Options

    Hi Thirukumaran,

    Which version are you using?

    In 2023 version, once you open a .hm file you can see the file name in top left corner and file directory information under "Model Info" in main work area.

    See the below pic.

    image

    Thanks

    Rajashri

  • Adriano A. Koga_21570
    Adriano A. Koga_21570
    Altair Employee
    edited April 4 Answer ✓
    Options

    Try these:

     

    set currentmodel [hm_info currentfile]

    set modelname [file tail $currentmodel]

    set dirname [file dirname $currentmodel]

     

  • Thirukumaran Subbian
    Thirukumaran Subbian
    Altair Community Member
    edited April 3
    Options

    Hi Thirukumaran,

    Which version are you using?

    In 2023 version, once you open a .hm file you can see the file name in top left corner and file directory information under "Model Info" in main work area.

    See the below pic.

    image

    Thanks

    Rajashri

    Hi Rajashri,

    Thank you for your inputs. I am in search of solution for Tcl/Hm commands to retrieve the filename for my Tcl script. And, I am currently using 2022.2 version of Hypermesh.

    Thanks!

    Thirukumaran

  • Thirukumaran Subbian
    Thirukumaran Subbian
    Altair Community Member
    edited April 4
    Options

    Hi, 

    I have identified the missing lead regarding the question posted by me. The commands posted by Adriano is working fine and is very much useful. Likewise, Thank you Rajashri for the inputs. The reply gave clarity as well regarding the empty outputs. If the model info is Untitled*, the command will give an empty output or an output with only "."

    Thanks for the inputs both!

    Thirukumaran