Introduction to HyperMesh and TCL
Introduction to HyperMesh and TCL
Aim :
- To do some basic steps to know about Tcl/Tk scripting in Hypermesh.
Objective :
- To Install “code writing tools” of our choice
- To Create a dummy tcl file and assign it to a key (Ctrl +1)
- To Set our keyboard shortcuts and export the settings file.
- To Locate and open the following files on your computer command. tcl/command.cmf, user page.mac, hmsettings.tcl
- To Set our text editor as the default program to read T files.
- To Open a .fem or any one of the solver files in your coding editor. Look for component names, thickness, etc. Are you able to locate them all?
Procedure :
1) To Install “code writing tools” of our choice :
- Installed NotePad++ Code writing tool, Which is shown in below Figure 1.
- Just open the Microsoft store or Chrome from your pc and type NotePad++ and search and install it.

| Figure 1-Installed Notepad++ Code Writing Tool. |
2) Create a dummy tcl file and assign it to a key (Ctrl +1) :
- To create a dummy .tcl file, Open any hm model with optistruct user file and do some operations like rotate the model, mask the elements, switch to the standard views and save the model.
- Next, open the documents folder, There .tcl file will be created, Which is shown in below Figure 2.

| Figure 2-.tcl File Created. |
- Next, open the hypermesh, Go to the Preference Panel >> Open the KeyBoard Settings >> Assign the Shortcut key for .tcl file created.

| Figure 3-Preference Panel. |
- In the keyboard settings, Switch to the Ctrl and Select 1 >> Type a name as .tcl file >> Browse the .tcl file created and select the .tcl file to assign a shortcut key. Which is shown in below Figure 4.

| Figure 4-Assign a Shortcut key for .tcl File Created. |
- Next press a shortcut key and check whether the shortcut key assigned for .tcl file is working or not. Which is shown in below Figure 5.

| Figure 5-Cross Check, Whether the Shortcut Key Assigned is Working or Not. |
3) Set your keyboard shortcuts and export the settings file :
- Export the shortcut settings, To export, Click on File >> Export >> Rename >> Save.This is shown in below two Figures 6 and 7.

| Figure 6-KeyBoard Settings Panel. |

| Figure 7-Save the File. |
4) Locate and open the following files on your computer command.tcl/command.cmf , userpage.mac, hmsettings.tcl :
- All the following files have been located and the command.tcl ,hmsettings files have opened, Which is shown in below Figures 8-10.

| Figure 8-command.tcl and hmsettings.tcl File. |

| Figure 9-command.cmf File. |

| Figure 10-userpage.mac File. |
5) Set your text editor as the default program to read tcl files :
- Hence the notepad++ text editor has been set the default to read .tcl files, Which is shown in below Figure 11.

| Figure 11-NotePad++ has been set default to read the .tcl files. |
6) Open a .fem or any one of the solver files in your coding editor. Look for component names, thickness, etc. Are you able to locate them all?

| Figure 12-Located Component and Thickness Names. |
Result :
- Hence installed “code writing tools” of our choice
- Hence created a dummy tcl file and assign it to a key (Ctrl +1).
- Hence the keyboard shortcuts were set and the settings file was exported.
- Hence located and opened the following files on our computer command.tcl/command.cmf , userpage.mac, hmsettings.tcl
- Hence the text editor notepad ++ was set as the default program to read tcl files.
- Hence opened a .fem or any one of the solver files in our coding editor. Look for component names, thickness, etc. and I was able to locate them all.