Does anyone know the way to get the name of the current model

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

Dear all,

 

I was trying to obtain the name of current model using tcl/tk, I only need the name of the model not the full path. For example if we saved the model as 1d_beam.hm, I wanna obtain this '1d_beam' using tcl/tk. I thought this will be simple but spent couple hours could not find the corresponding entity for this. Does anyone has a clue on this problem? 

 

Regards,

 

Chong

Tagged:

Answers

  • tinh
    tinh Altair Community Member
    edited April 2013

    Hi,

    it's root-name of tail of file:

     

    set rootname [file rootname [file tail [hm_info currentfile]]

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2013

    The same result with:  file rootname [file tail [hm_info hmfilename]]

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2013

    Thanks for the help~~