TK script text variable: user input

Saravanan R_20730
Saravanan R_20730 Altair Community Member
edited August 7 in Community Q&A

Hello,

in the below script, am trying to get the input from text variable. But everytime its throwing error and unable to rectify. 

in the below script, highlighted in bold (w) is the user input. Can anyone help?

set win .window
catch {destroy $win}
toplevel $win -class TopClass
wm title $win "2D / 3D Quality Check"
wm geometry $win 550x330+300+300
wm resizable $win 0 0
wm deiconify $win 
 
entry $win.04 -textvariable w -font {times 10 bold} -justify center
place $win.04 -x 160 -y 60 -width 140 -height 32
 
proc warpage {w} {
*nodecleartempmark 
proc Isolate2D {{opt all}} {
    *displaynone
    *createmark elems 1 "by config" tria3 quad4 tria6 quad8
    set ElelementSet [ hm_getmark elems 1 ]
    if { [llength $ElelementSet] >= 1} {
    *findmark elems 1 0 1 elems 0 2   
## 2D Warpage check
 
*createmark elements 1 "displayed"
*createmark elements 2
*elementtestwarpage elements 1 $w 2 2 0 "  2D Warpage  "
*marktousermark elements 2
*createmark elements 1 "retrieve"
set retrieve [hm_getmark elems 1]
set nLen [llength $retrieve]
if {$nLen > 0} {
Message "2D Quality: WARPAGE for 59: FAIL";
} else {
Message "2D Quality: WARPAGE for 59: PASS";
}
    } else {
    Message "No 2D elements to check";
    }
    *clearmark elems 1
    *clearmark elems 2
}
Isolate2D
}
 
label $win.01 -text "2D Element Quality" -bg grey -font {times 20 bold}
place $win.01 -x 10 -y 10 -width 250 -height 32
 
button $win.03 -text "2D Warpage" -font {times 12 bold} -command {warpage $w
place $win.03 -x 60 -y 60 -width 140 -height 32

 

 

Answers