Professional Documents
Culture Documents
Hmath Tutorial: Debugging TCL Script Using Scriptview
Hmath Tutorial: Debugging TCL Script Using Scriptview
TCL macros written for HyperWorks can be debugged using ScriptView. This eliminates the
requirement of using print statements to guess location where the macro failed to work. The
two requirements to debug the TCL script in ScriptView are: 1) User needs to use
HyperMesh Desktop 2) The TCL macro must be contained in a procedure.
This tutorial demonstrates the way to link HyperWorks Desktop with ScriptView for live
debugging. The TCL Script used in this tutorial allows the user to select a single circle and
outputs the radius and the diameter of the circle. As the TCL script is debugged, it highlights
the usage of “watch window”, breakpoints etc.
1
4. Notice that ScriptView is launched with radius.tcl file already loaded in the editor
window
5. Notice that a blue triangle appears in line 38 indicating that the procedure
::madapadi_051909::main is being evaluated
6. Click to add breakpoints (shown as circles) on lines 16, 24 and 29
8. The control is now transferred to HyperMesh Desktop. Click on any one circumference
of a hole in the model and then click proceed
9. The control is now transferred to ScriptView, notice the program is highlighted in the
windows bar.
10. The blue arrow is now located at line 16; which is the location of the first breakpoint.
11. Click on the third icon (Step Over) as shown in Step 7 to move the blue arrow to line 18.
Move the cursor on top of variable “c” in line 16 to see the value of that variable as shown
in the picture below.
2
12. Click on the second icon in Step 7 (Continue) to proceed to the second breakpoint at
line 24.
13. Click on the third icon in Step 7 (Step Over) to proceed to the line 25.
14. Move the cursor over the variable d_x to find its value
15. Click the second icon in Step 7(Continue) to proceed to line 30 and move the cursor
over the variable diameter to find it’s value.
16. Click the second icon in Step 7(Continue) to complete the execution of the macro and
the following dialog appears.