Week - 6 - Creating the GUI for final checks
Report week 6 Creating the GUI for final checks
Objective:Create a tk GUI for all the final checks / operations
Problem Statement:
- Create buttons to delete displayed geometric entities (be careful about advanced remesh)
- Create buttons to delete empty entities
- Create button to re-order and re-number entities by name
- Create a master button in red that will execute all above scripts in proper order to keep only the fea entities. Name the button master
Tcl command explanation:
(create a window)
set a .window
catch {destroy $a}
toplevel $a -class TopLevelwm title $a "Final Checks"
wm geometry $a 300x500+50+50
wm resizable $a 0 0
wm deiconify $a
(create lables and bottons)
label $a.01 -text "DELETE ENTITIES" -bg gray ; place $a.01 -x 20 -y 10 -width 270 -height 20
label $a.02 -text "DELETE EMPTY ENTITIES" -bg gray ; place $a.02 -x 20 -y 110 -width 270 -height 20
label $a.03 -text "RE-ORDER" -bg gray ; place $a.03 -x 20 -y 210 -width 270 -height 20
label $a.031 -text "RE-NUMBER" -bg gray ; place $a.031 -x 20 -y 310 -width 270 -height 20
label $a.032 -text "------------" -bg gray ; place $a.032 -x 20 -y 390 -width 270 -height 20
button $a.04 -text "Delete surfaces" -command {delete surfaces} -font {arial 9 };place $a.04 -x 20 -y 45 -width 120 -height 40
button $a.05 -text "Delete solids" -command {delete solids} -font {arial 9 };place $a.05 -x 170 -y 45 -width 120 -height 40
(delete procedure)
proc delete {d} {
*createmark $d 1 "displayed"
if {[hm_marklength $d 1] !=0} {*deletemark $d 1}
}
button $a.06 -text "Empty comps" -command {empty comps} -font {arial 9 };place $a.06 -x 20 -y 150 -width 120 -height 40
button $a.07 -text "Empty Assembly" -command {empty assemblies} -font {arial 9 };place $a.07 -x 170 -y 150 -width 120 -height 40
(empty procudure)
proc empty {e} {
*EntityPreviewEmpty $e 1
if {[hm_marklength $e 1] !=0} {*deletemark $e 1}
}
button $a.08 -text "Reorder Comps" -command {reorderbyname comps} -font {arial 7 };place $a.08 -x 20 -y 250 -width 120 -height 40
button $a.09 -text "Reorder Comps" -command {reorderbyid comps} -font {arial 8 };place $a.09 -x 170 -y 250 -width 120 -height 40
(renumber and reorder procudure)
proc reorderbyname {o} {
*clearmarkall 1
*createmark $o 1 "all"
if {[hm_marklength $o 1] !=0} {*collectormarkmove $o 1 1 1}
}
proc reorderbyid {o} {
*clearmarkall 1
*createmark $o 1 "all"
if {[hm_marklength $o 1] !=0} {*collectormarkmove $o 1 1 2}
}
button $a.10 -text "Renumber Comps" -command {renumber comps} -font {arial 7 };place $a.10 -x 20 -y 340 -width 120 -height 40
button $a.11 -text "Renumber Props" -command {renumber props} -font {arial 7 };place $a.11 -x 170 -y 340 -width 120 -height 40
proc renumber {n} {
*clearmarkall 1
*createmark $n 1 "all"
if {[hm_marklength $n 1] !=0} {*renumber $n 1 100 1 0 0 }
}
button $a.12 -text "MASTER" -command {master} -bg RED -font {Times 10 bold};place $a.12 -x 80 -y 420 -width 140 -height 60
(do it all procedure)
proc master {} {
delete surfaces
delete solids
empty comps
empty assemblies
reorderbyid comps
reorderbyname comps
renumber props
renumber comps
}
Conclusion: task is completed as described above
