Challenge

Week - 6 - Creating the GUI for final checks

Objective:

To create gui for deleting and final checks

Procedure:

creation of window and buttons for specific operations

Deleting geometry, empty components, properties and elements

Renumberring

set gui .window
catch {destroy $gui}
toplevel $gui -class Toplevel
wm title $gui "Checks"
wm geometry $gui 300x300+600+500
wm resizable $gui 0 0
wm deiconify $gui

proc delete {a} {
*createmark $a 1 "displayed"
if {[llength [hm_getmark $a 1]] != 0} {*deletemark $a 1}
}
proc deleteemp {a} {
*EntityPreviewEmpty $a 1
if {[llength [hm_getmark $a 1]] != 0} {*deletemark $a 1}
}
proc deleteunu {a} {
*EntityPreviewUnused $a 1
if {[llength [hm_getmark $a 1]] != 0} {*deletemark $a 1}
}
proc reorder {a} {
*createmark components 1 "all"
if {[llength [hm_getmark components 1]] != 0} {*collectormarkmove components 1 1 1}
*createmark properties 1 "all"
if {[llength [hm_getmark properties 1]] != 0} {*collectormarkmove properties 1 1 1}
*createmark materials 1 "all"
if {[llength [hm_getmark materials 1]] != 0} {*collectormarkmove materials 1 1 1}
}
proc renumber {a} {
*renumbersolveridall 2 2 0 0 0 0 0
}
proc master {a} {
*createmark surfaces 1 "all"
if {[llength [hm_getmark surfaces 1]] != 0} {*deletemark surfaces 1}
*createmark solids 1 "all"
if {[llength [hm_getmark solids 1]] != 0} {*deletemark solids 1}
*createmark points 1 "all"
if {[llength [hm_getmark points 1]] != 0} {*deletemark points 1}
*createmark lines 1 "all"
if {[llength [hm_getmark lines 1]] != 0} {*deletemark lines 1}
*EntityPreviewEmpty components 1
if {[llength [hm_getmark components 1]] != 0} {*deletemark components 1}
*EntityPreviewUnused properties 1
if {[llength [hm_getmark properties 1]] != 0} {*deletemark properties 1}
*EntityPreviewUnused materials 1
if {[llength [hm_getmark materials 1]] != 0} {*deletemark materials 1}
*createmark components 1 "all"
if {[llength [hm_getmark components 1]] != 0} {*collectormarkmove components 1 1 1}
*createmark properties 1 "all"
if {[llength [hm_getmark properties 1]] != 0} {*collectormarkmove properties 1 1 1}
*createmark materials 1 "all"
if {[llength [hm_getmark materials 1]] != 0} {*collectormarkmove materials 1 1 1}
*renumbersolveridall 2 2 0 0 0 0 0
}

button $gui.01 -text "Delete points" -command {delete points} -font {time 10}; place $gui.01 -x 50 -y 5
button $gui.02 -text "Delete lines" -command {delete lines} -font {time 10}; place $gui.02 -x 150 -y 5
button $gui.03 -text "Delete surfaces" -command {delete surfaces} -font {time 10}; place $gui.03 -x 40 -y 35
button $gui.04 -text "Delete solids" -command {delete solids} -font {time 10}; place $gui.04 -x 150 -y 35
button $gui.05 -text "Delete Empty Components" -command {deleteemp components} -font {time 10}; place $gui.05 -x 50 -y 65
button $gui.06 -text "Delete unused Prop" -command {deleteunu properties} -font {time 10}; place $gui.06 -x 30 -y 95
button $gui.07 -text "Delete unused mat" -command {deleteunu materials} -font {time 10}; place $gui.07 -x 175 -y 95
button $gui.08 -text "Reorder" -command {reorder all} -font {time 10}; place $gui.08 -x 50 -y 125
button $gui.09 -text "Renumber" -command {renumber all} -font {time 10}; place $gui.09 -x 150 -y 125
button $gui.10 -text "master" -command {master all} -bg red -font {time 10 bold}; place $gui.10 -x 100 -y 175

Conclusion:

the code can be more refined using procedures for procedures

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.