How can I get the name of the current model opened in Hypermesh?
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!
Best Answer
-
Try these:
set currentmodel [hm_info currentfile]
set modelname [file tail $currentmodel]
set dirname [file dirname $currentmodel]
1
Answers
-
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.
Thanks
Rajashri
1 -
Try these:
set currentmodel [hm_info currentfile]
set modelname [file tail $currentmodel]
set dirname [file dirname $currentmodel]
1 -
Rajashri Saha_20525 said:
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.
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
0 -
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
0