Project 1- Building a Master TCL/TK Macro
OBJECTIVE:-
- Build a master tcl/tk macro
- It should contain buttons that will call all utilities created as assignments during this course
- Segregate the buttons as per their utility. Color code the buttons as you see fit.
- Display labels that indicate an idea of your segregation
- The design must look ergonomic and clutter free
- Test all the buttons thoroughly on am empty file too.
- Make sure that there are no null cases
To create tcl for all lectures illustrated in the course
TCL COMMAND EXPLANATION:-
set a .window
catch {destroy $a}
toplevel $a -class top-level
wm title $a "Master-01"
wm geometry $a 360x780+100+200
# creating window with name Master-01
# if already exists, destroy it

label $a.21 -text "2D" -bg green -font {times 10 bold}; place $a.21 -x 30 -y 00 -width 50 -height 20
# label created name 2D

button $a.01 -text "Warpage" -command "Warpage" -bg grey -font {times 12 bold}; place $a.01 -x 10 -y 30 -width 100 -height 30
# Button created Warpage with command checking warpage

entry $a.02 -textvariable ::warpage ; place $a.02 -x 120 -y 30 -width 40 -height 30
# entry created for Warpage with entry box

button $a.03 -text "Aspect" -command "Aspect" -bg grey -font {times 12 bold}; place $a.03 -x 10 -y 70 -width 100 -height 30
# Button created aspect with command checking aspect

entry $a.04 -textvariable ::aspect ; place $a.04 -x 120 -y 70 -width 40 -height 30
# entry created for aspect with entry box

button $a.05 -text "Skew" -command "Skew" -bg grey -font {times 12 bold}; place $a.05 -x 10 -y 110 -width 100 -height 30
# Button created skew with command checking skew

entry $a.06 -textvariable ::skew ; place $a.06 -x 120 -y 110 -width 40 -height 30
# entry created for skew with entry box

button $a.07 -text "MinLength" -command "MinLength" -bg grey -font {times 12 bold}; place $a.07 -x 10 -y 150 -width 100 -height 30
# Button created minlength with command checking minlength

entry $a.08 -textvariable ::minlength ; place $a.08 -x 120 -y 150 -width 40 -height 30
# entry created for minlength with entry box

button $a.09 -text "MaxLength" -command "MaxLength" -bg grey -font {times 12 bold}; place $a.09 -x 10 -y 190 -width 100 -height 30
# Button created maxlength with command checking maxlength

entry $a.10 -textvariable ::maxlength ; place $a.10 -x 120 -y 190 -width 40 -height 30
# entry created for maxlength with entry box

button $a.11 -text "Jacobian" -command "Jacobian" -bg grey -font {times 12 bold}; place $a.11 -x 10 -y 230 -width 100 -height 30
# Button created jacobian with command checking jacobian

entry $a.12 -textvariable ::jacobian ; place $a.12 -x 120 -y 230 -width 40 -height 30
# entry created for jacobian with entry box

button $a.13 -text "TriaMinAngle" -command "TriaMinAngle" -bg grey -font {times 11 bold}; place $a.13 -x 10 -y 270 -width 100 -height 30
# Button created mintriangle with command checking mintriangle

entry $a.14 -textvariable ::triaminangle ; place $a.14 -x 120 -y 270 -width 40 -height 30
# entry created for triaminangle with entry box

button $a.15 -text "TriaMaxAngle" -command "TriaMaxAngle" -bg grey -font {times 11 bold}; place $a.15 -x 10 -y 310 -width 100 -height 30
# Button created maxtriangle with command checking maxtriangle

entry $a.16 -textvariable ::triamaxangle ; place $a.16 -x 120 -y 310 -width 40 -height 30
# entry created for triamaxangle with entry box

button $a.17 -text "QuadMinAngle" -command "QuadMinAngle" -bg grey -font {times 10 bold}; place $a.17 -x 10 -y 350 -width 100 -height 30
# Button created minquadangle with command checking minquadangle

entry $a.18 -textvariable ::quadminangle ; place $a.18 -x 120 -y 350 -width 40 -height 30
# entry created for quadminangle with entry box

button $a.19 -text "QuadMaxAngle" -command "QuadMaxAngle" -bg grey -font {times 10 bold}; place $a.19 -x 10 -y 390 -width 100 -height 30
# Button created maxquadangle with command checking maxquadangle

entry $a.20 -textvariable ::quadmaxangle ; place $a.20 -x 120 -y 390 -width 40 -height 30
# entry created for quadmaxangle with entry box

label $a.22 -text "3D" -bg green -font {times 10 bold}; place $a.22 -x 200 -y 00 -width 50 -height 20
# label created name 3D

button $a.23 -text "Warpage" -command "Warpage3D" -bg grey -font {times 12 bold}; place $a.23 -x 180 -y 30 -width 100 -height 30
# Button created warpage with command checking warpage 3d

entry $a.24 -textvariable ::warpage3d ; place $a.24 -x 290 -y 30 -width 40 -height 30
# entry created for warpage 3d with entry box

button $a.27 -text "Aspect" -command "Aspect" -bg grey -font {times 12 bold}; place $a.27 -x 180 -y 70 -width 100 -height 30
# Button created aspect 3d with command checking aspect

entry $a.28 -textvariable ::aspect3d ; place $a.28 -x 290 -y 70 -width 40 -height 30
# entry created for aspect 3d with entry box

button $a.29 -text "TetCollapse" -command "TetCollapse" -bg grey -font {times 12 bold}; place $a.29 -x 180 -y 110 -width 100 -height 30
# Button created tetcollapse with command checking TetCollapse

entry $a.30 -textvariable ::tetcollapse ; place $a.30 -x 290 -y 110 -width 40 -height 30
# entry created for tetcollapse 3d with entry box

button $a.31 -text "MinLength" -command "MinLength" -bg grey -font {times 12 bold}; place $a.31 -x 180 -y 150 -width 100 -height 30
# Button created minlength 3d with command checking minlength

entry $a.32 -textvariable ::minlength3d ; place $a.32 -x 290 -y 150 -width 40 -height 30
# entry created for minlength 3d with entry box

button $a.33 -text "MaxLength" -command "MaxLength" -bg grey -font {times 12 bold}; place $a.33 -x 180 -y 190 -width 100 -height 30
# Button created maxlength 3d with command checking maxlength

entry $a.34 -textvariable ::maxlength3d ; place $a.34 -x 290 -y 190 -width 40 -height 30
# entry created for maxlength 3d with entry box

button $a.25 -text "Jacobian" -command "Jacobian" -bg grey -font {times 12 bold}; place $a.25 -x 180 -y 230 -width 100 -height 30
# Button created jacobian3d with command checking jacobian

entry $a.26 -textvariable ::jacobian3d ; place $a.26 -x 290 -y 230 -width 40 -height 30
# entry created for jacobian 3d with entry box

label $a.36 -text "Edges" -bg white -font {times 10 bold}; place $a.36 -x 200 -y 270 -width 100 -height 30
# label created name Edges

button $a.37 -text "Free Edge" -command {FreeEdges} -bg Red -font {times 10 bold}; place $a.37 -x 180 -y 310 -width 70 -height 25
# Button created freeedge with command freeedges

button $a.38 -text "T Edge" -command {TEdges} -bg cyan -font {times 10 bold}; place $a.38 -x 270 -y 310 -width 70 -height 25
# Button created t edge with command tedges

button $a.39 -text "Both" -command {Both} -bg yellow -font {times 10 bold}; place $a.39 -x 180 -y 350 -width 70 -height 25
# Button created both with command free edge and t edges

button $a.40 -text "OFF" -command {OFF} -bg green -font {times 10 bold}; place $a.40 -x 270 -y 350 -width 70 -height 25
# Button created off with command edgesoff

label $a.41 -text "ElementQuality" -bg white -font {times 10 bold}; place $a.41 -x 90 -y 00 -width 100 -height 20
# label created name ElementQuality

label $a.42 -text "Normals" -bg white -font {times 10 bold}; place $a.42 -x 110 -y 440 -width 100 -height 20
# label created name Normals

button $a.43 -text "Normalson" -command {Normalson} -bg red -font {times 10 bold}; place $a.43 -x 50 -y 470 -width 70 -height 25
# Button created normalson with command normalson

button $a.44 -text "Normalsreverse" -command {Normalsreverse} -bg cyan -font {times 10 bold}; place $a.44 -x 130 -y 470 -width 100 -height 25
# Button created normalsoreverse with command normalsreverse

button $a.45 -text "Normalsoff" -command {Normalsoff} -bg grey -font {times 10 bold}; place $a.45 -x 240 -y 470 -width 70 -height 25
# Button created normalsoff with command normalsoff

button $a.46 -text "Reflect" -command {Reflect} -bg grey -font {times 10 bold}; place $a.46 -x 140 -y 510 -width 70 -height 25
# Button created reflect with command reflect

label $a.47 -text "IDs_Check" -bg white -font {times 10 bold}; place $a.47 -x 120 -y 550 -width 100 -height 20
# label created name IDs_Check

button $a.48 -text "Renumber" -command {renumber} -bg cyan -font {times 10 bold}; place $a.48 -x 50 -y 570 -width 70 -height 25
# Button created renumber with command renumber

button $a.49 -text "ReorderN" -command {reorderbyname} -bg yellow -font {times 10 bold}; place $a.49 -x 150 -y 570 -width 70 -height 25
# Button created reorderN with command reorder by name

button $a.50 -text "ReorderID" -command {reorderbyid} -bg green -font {times 10 bold}; place $a.50 -x 250 -y 570 -width 70 -height 25
# Button created reorderid with command reorder by id.

label $a.52 -text "Delete" -bg white -font {times 10 bold}; place $a.52 -x 110 -y 620 -width 100 -height 20
# label created name Delete

button $a.51 -text "Solids" -command "delete solids" -bg grey -font {times 10 bold}; place $a.51 -x 50 -y 650 -width 60 -height 25
# Button created solids with command delete solids

button $a.53 -text "Surfaces" -command "delete surfaces" -bg grey -font {times 10 bold}; place $a.53 -x 120 -y 650 -width 60 -height 25
# Button created surfaces with command delete surfaces

button $a.54 -text "Lines" -command "delete Lines" -bg grey -font {times 10 bold}; place $a.54 -x 190 -y 650 -width 60 -height 25
# Button created lines with command delete lines

button $a.55 -text "Points" -command "delete points" -bg grey -font {times 10 bold}; place $a.55 -x 260 -y 650 -width 60 -height 25
# Button created points with command delete points

label $a.56 -text "Empty" -bg white -font {times 10 bold}; place $a.56 -x 110 -y 690 -width 100 -height 20
# label created name Empty

button $a.57 -text "Comps" -command "empty comps" -bg grey -font {times 10 bold}; place $a.57 -x 80 -y 710 -width 70 -height 25
# Button created comps with command empty comps

button $a.58 -text "Assemblies" -command "empty assemblies" -bg grey -font {times 10 bold}; place $a.58 -x 170 -y 710 -width 80 -height 25
# Button created Assemblies with command empty assemblies

proc Warpage {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestwarpage elements 1 $::warpage 2 2 0 "2D Warpage"
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the warpage of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc Warpage3D {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestwarpage elements 1 $::warpage3d 2 4 0 "3D Warpage"
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the warpage of elements in 3d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc Aspect {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestaspect elements 1 $::aspect 2 2 0 " 2D Aspect Ratio "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the aspect of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc Aspect {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestaspect elements 1 $::aspect3d 2 4 0 " 3D Aspect Ratio "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the aspect of elements in 3d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc Skew {} {
*clearmarkall 1
*clearmarkall 2
*createmark elements 1 "displayed"
*elementtestskew elements 1 $::skew 2 2 0 " 2D Skew "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the skew of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc TetCollapse {} {
*clearmarkall 1
*clearmarkall 2
*createmark elements 1 "displayed"
*elementtesttetracollapse elements 1 $::tetcollapse 2 0 " 3D Tetra Collapse "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the tetcollapse of elements in 3d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc MinLength {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestlength elements 1 $::minlength 2 1 2 0 " 2D Length < "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the minlength of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc MaxLength {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestlength elements 1 $::maxlength 2 0 2 0 " 2D Length > "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the maxlength of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc MinLength {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestlength elements 1 $::minlength3d 2 1 4 0 " 3D Length < "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the minlength of elements in 3d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc MaxLength {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestlength elements 1 $::maxlength3d 2 0 4 0 " 3D Length > "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the maxlength of elements in 3d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc Jacobian {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestjacobian elements 1 $::jacobian 2 2 0 " 2D Jacobian "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the jacobian of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc Jacobian {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestjacobian elements 1 $::jacobian3d 2 4 0 " 3D Jacobian "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the jacobian of elements in 3d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc TriaMinAngle {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestinterangle elements 1 $::triaminangle 1 2 1 2 0 " 2D Tria Min Angle "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the mintria angle of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc TriaMaxAngle {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestinterangle elements 1 $::triamaxangle 1 2 0 2 0 " 2D Tria Max Angle "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the maxtria angle of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc QuadMinAngle {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestinterangle elements 1 $::quadminangle 0 2 1 2 0 " 2D Quad Min Angle "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the minquad angle of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc QuadMaxAngle {} {
*clearmarkall 1
*clearmarkall 2
*nodecleartempmark
*createmark elements 1 "displayed"
*elementtestinterangle elements 1 $::quadmaxangle 0 2 0 2 0 " 2D Quad Max Angle "
*maskentitymark elements 2 0
*maskreverse elements
*createmark nodes 1 "displayed"
*nodemarkaddtempmark 1
*unmaskall2
}
# Clearing the saved list
# clearing the node list -- temporary nodes
# saving the displayed elements
# checking the maxquad angle of elements in 2d elements
# saving the failed elements
# reversing the elements
# creating nodes on the displayed elements
# unmasking the elements
proc FreeEdges {} {
*setdisplayattributes 4 1
*createmark elements 1 "displayed"
if {[hm_entityinfo exist comps FreeEdges ]==0 } {
*findedges1 elements 1 0 0 0 30
*setvalue comps name={^edges} name={FreeEdges}
*createmark components 1 "FreeEdges"
*setvalue components mark=1 color=3
*createmark elems 1 "displayed"
*equivalence elems 1 0.01 0 0 0
*equivalence elems 1 0.01 3 0 0
*createmark nodes 1 "retrieve"
*nodemarkaddtempmark 1
} else {
tk_messageBox -message "Already Exists" -icon info -type ok
}
}
proc TEdges {} {
*setdisplayattributes 4 1
*createmark elements 1 "displayed"
if {[hm_entityinfo exist comps TEdges ]==0 } {
*findedges1 elements 1 0 0 0 30
*setvalue comps name={^edges} name={TEdges}
*createmark components 1 "TEdges"
*setvalue components mark=1 color=30
} else {
tk_messageBox -message "Already Exists" -icon info -type ok
}
}
proc Both {} {
FreeEdges;
TEdges;
}
proc OFF {} {
*createmark components 1 "FreeEdges" "TEdges"
*deletemark components 1
*setdisplayattributes 2 0
*clearmark nodes 1
*nodecleartempmark 1
}
proc Normalson {} {
*clearmarkall 1
*setnormalsdisplaytype 1
*createmark elements 1 "displayed"
*normalsdisplay elements 1
}
# *clearmarkall 1 --- whatever the saved or marked items, it will be cleared
# *setnormalsdisplaytype 1 --- showing normal display as color mode
# *createmark elements 1 "displayed“ --- selecting the elements as displayed
# *normalsdisplay elements 1 – displaying normal as selected as displayed
proc Normalsoff {} {
*normalsoff
}
# *normalsoff---- saved in reverse.tcl and assign to shortcut key 2 using Preferences --- keyboard settings---using path and tcl
proc Normalsreverse {} {
*createmark elements 1 "displayed"
*normalsreverse elements 1
}
# *createmark elements 1 "displayed"; *normalsreverse elements 1 ---- saved in reverse.tcl and assign to shortcut key 1 using
# Preferences --- keyboard settings---using path and tcl
proc abaqus {a t1} {
set n [concat $a$t1]
if {[hm_entityinfo exist comps $n]==0} {
*createentity comps name=$n
*createmark comps 1 $n
set compid [hm_getmark comps 1]} else {puts "Entity already exists"}
if {[hm_entityinfo exist props $n]==0} {
*createentity props cardimage=SHELLSECTION includeid=0 name=$n
*createmark properties 2 $n
set propid [hm_getmark props 2]
set clr [hm_getvalue comps name=$n dataname=color]
*setvalue props id=$propid STATUS=1 111=$t1 color=$clr
*setvalue comps id=$compid propertyid ={props $propid}}
}
proc Reflect {a} {
*clearmarkall 1 ; *clearmarkall 2
set name [hm_getstring Component_Name "Enter the reflect component name ends with _"]
*createmarkpanel comps 1 "Select the reflect component"
set o_geom [hm_getmark comps 1]
*createmarkpanel comps 1 "Select the target geometry Component"
set t_geom [hm_getmark comps 1]
*createmarkpanel comps 1 "Select the reflect FE components"
set o_fea [hm_getmark comps 1]
set profile [hm_info templatetype]
foreach i $o_fea {
set t [hm_getthickness comps $i]
set old_n [hm_entityinfo name comps $i]
set u [string index $t 0]
set v [string index $t 2]
set p p
set Ts $u$p$v
set n [concat $name$Ts]
$profile $name $Ts
*createmark elems 1 $old_n
*copymark elems 1 $n
*displaycollectorwithfilter comps "off" "$old_n" 1 0
}
*createmark comps 2 "displayed"
*autocolorwithmark comps 2
*clearmarkall 1 ; *clearmarkall 2
*createmark surfaces 1 "by collector" $o_geom
set o_cog [hm_getcentroid surfaces 1]
*createnode [lindex $o_cog 0] [lindex $o_cog 1] [lindex $o_cog 2] 0
*createmark nodes 2 -1
set o_node [hm_getmark nodes 2]
*createmark surfaces 1 "by collector" $t_geom
set t_cog [hm_getcentroid surfaces 1]
*createnode [lindex $t_cog 0] [lindex $t_cog 1] [lindex $t_cog 2] 0
*createmark nodes 2 -1
set t_node [hm_getmark nodes 2]
set intercepts [hm_getdistance nodes $o_node $t_node 0]
*clearmarkall 1
*createnodesbetweennodes $o_node $t_node 1
*createmark nodes 1 -1
set m_node [hm_getmark nodes 1]
set m_nodeinfo [hm_nodevalue $m_node]
*clearmarkall 1
*createmark elems 1 "displayed"
*createplane 1 [lindex $intercepts 1] [lindex $intercepts 2] [lindex $intercepts 3] [lindex $m_nodeinfo 0 0] [lindex $m_nodeinfo 0 1] [lindex $m_nodeinfo 0 2]
*reflectmarkwithoption elems 1 1 0
*clearmarkall 1; *clearmarkall 2
*createmark comps 1 "displayed"
*equivalence comps 1 0.01 1 0 0
}
# procedure for reflect
proc renumber {a} {
*clearmarkall 1
*createmark $a 1 "all"
if {[hm_marklength $a 1] !=0} {*renumber $a 1 100 1 0 0 }
}
# clearing the saved items
# saving the lists
# if selcted exists, renumber collector
proc reorderbyname {a} {
*clearmarkall 1
*createmark $a 1 "all"
if {[hm_marklength $a 1] !=0} {*collectormarkmove $a 1 1 1}
}
# clearing the saved items
# saving the lists
# if selcted exists, reorder by name
proc reorderbyid {a} {
*clearmarkall 1
*createmark $a 1 "all"
if {[hm_marklength $a 1] !=0} {*collectormarkmove $a 1 1 2}
}
# clearing the saved items
# saving the lists
# if selcted exists, reorder by id
proc delete {a} {
*createmark $a 1 "displayed"
if {[hm_marklength $a 1] !=0} {*deletemark $a 1}
}
# creating selected collectors
# if exists delete it
proc empty {a} {
*EntityPreviewEmpty $a 1
if {[hm_marklength $a 1] !=0} {*deletemark $a 1}
}
# creating selected collectors
# if exists empty collectors. delete it
CONCLUSION:-
Thus,

- Rolandojos Torres SáNchezthe GUI should adapt to the size of the user's screen and the resolution that works on the screen
- Rolandojos Torres SáNchezA variable h that is the height in pixels of the screen resolution. set h [winfo screenheihgt .] Then the geometry is defined based on the width and height variables of the screen. wm geometry [expr $w/4*3]x[expr $h/4*3]+[expr $w/8]+[expr $h/8] This way the GUI will look the same regardless of screen resolution.