Challenge

Project 1- Building a Master TCL/TK Macro

Objective:

To create a Master GUI with buttons that will call all the utilities that were created as assignments.

Problem Statement:

- Instead of running each file with utilities individually, it is efficient if all the utilities are assigned to buttons and these buttons are put in a master GUI.

- A GUI with buttons were created and each buttons were linked to a specific utility. Based on the requirement, the processes are performed

Procedure:

- On running the ‘Project1-Building a Master TCL TK Macro-1.tcl’ script, Master macro window opens.

- Based on the requirements, click on the button given in the Master macro

- The same codes and the procedures used in the assignments were used for this project

Code:

# Project1- Building a Master TCL/TK Macro

# The ideas is to leave the students with a consolidated utility for all the macros developed during the course of this lecture.

# 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

# ---------------------------------- Procedures ---------------------------------------------
# ---------------------------------- Assignment-2 ---------------------------------------------
proc assign_2 {} {
set ::res_fact ""
set ::fact ""

set a2 .window1
catch {destroy $a2}
toplevel $a2 -class toplevel

wm geometry $a2 400x150+650+150
wm title $a2 "Find Factorial"
wm resizable $a2 0 0
wm deiconify $a2

label $a2.01 -text "Enter the numbers:" -font {times 11}
place $a2.01 -x 20 -y 20

entry $a2.03 -textvariable ::fact -font {times 11}
place $a2.03 -x 140 -y 20 -width 130 -height 25

button $a2.04 -text "Calculate" -command {fact_proc} -font {times 11}
place $a2.04 -x 20 -y 60 -width 100 -height 25

entry $a2.05 -textvariable ::res_fact -font {times 11}
place $a2.05 -x 140 -y 60 -width 130 -height 25
}

proc fact_proc {} {
set ::res_fact ""
foreach i $::fact {
set result 1
for {set j 1} {$j<=$i} {incr j} {
set result [expr $result*$j]
}
lappend ::res_fact $result
}
set op_file [open "Factorial.txt" w]
set new_name "Vetri"
puts $op_file $new_name
puts $op_file "Factorial of $::fact are $::res_fact respectively"
close $op_file
}
# ---------------------------------- Assignment-3 ---------------------------------------------
proc assign_3 {} {
*clearmarkall 1; *clearmarkall 2
set ::comp_name_3 ""

set a3 .window1
catch {destroy $a3}
toplevel $a3 -class toplevel

wm geometry $a3 400x150+650+150
wm title $a3 "Delete Elements"
wm resizable $a3 0 0
wm deiconify $a3

button $a3.01 -text "Delete elements" -font {times 11} -command {delete_proc;wm deiconify $a}
place $a3.01 -x 30 -y 20 -width 130 -height 25

label $a3.02 -text "Elements are deleted from:" -font {times 11}
place $a3.02 -x 20 -y 60

entry $a3.03 -textvariable ::comp_name_3 -font {times 11}
place $a3.03 -x 190 -y 60 -width 130 -height 25
}

proc delete_proc {} {
*clearmarkall 1; *clearmarkall 2
*createmarkpanel elems 1
if {[hm_marklength elems 1] != 0} {
set elems_select [hm_getmark elems 1]
foreach i $elems_select {
lappend ::comp_name_3 [hm_getvalue elems id=$i dataname=component.name]
}
eval *deletemark elems 1 $elems_select
}
}
# ---------------------------------- Assignment-4 ---------------------------------------------
proc assign_4 {} {
*clearmarkall 1; *clearmarkall 2
set a4 .window1
catch {destroy $a4}
toplevel $a4 -class TopLevel

wm title $a4 "Calculator"
wm geometry $a4 250x300+650+150
wm resizable $a4 0 0

set ::num1 0
set ::num2 0
set ::sum ""
set ::sub ""

label $a4.01 -text "Number1:" -font {times 11}
place $a4.01 -x 30 -y 20 -width 70 -height 25

label $a4.02 -text "Number2:" -font {times 11}
place $a4.02 -x 30 -y 50 -width 70 -height 25

entry $a4.03 -textvariable ::num1
place $a4.03 -x 110 -y 20 -width 80 -height 25

entry $a4.04 -textvariable ::num2
place $a4.04 -x 110 -y 50 -width 80 -height 25

button $a4.05 -text "sum" -command {sum_proc $num1 $num2}
place $a4.05 -x 30 -y 80 -width 70 -height 25

button $a4.06 -text "substract" -command {sub_proc $num1 $num2}
place $a4.06 -x 30 -y 110 -width 70 -height 25

entry $a4.07 -textvariable ::sum
place $a4.07 -x 110 -y 80 -width 75 -height 25

entry $a4.08 -textvariable ::sub
place $a4.08 -x 110 -y 110 -width 75 -height 25

button $a4.09 -text "dummy calculator" -command {dummy_calc_proc}
place $a4.09 -x 50 -y 200 -width 100 -height 25
}

proc sum_proc {m n} {
if {$m != 0 || $n !=0} {
eval set ::sum [expr $m+$n]
} else {eval set ::sum 0}
}

proc sub_proc {m n} {
if {$m != 0 || $n !=0} {
eval set ::sub [expr $n-$m]
} else {eval set ::sub 0}
}

proc dummy_calc_proc {} {
set a4B .window1
catch { destroy $a4B}
toplevel $a4B -class TopLevel

wm title $a4B "Dummy Calculator"
wm geometry $a4B 400x425+650+150; update
wm resizable $a4B 0 0

set head "≡ Standard "
label $a4B.l1 -text $head -font {times 20} -justify left
place $a4B.l1 -x 0 -y 2 -width 250 -height 40

set ini 0
entry $a4B.e1 -text ini -justify right -font {times 50}
place $a4B.e1 -x 10 -y 50 -width 375 -height 99

button $a4B.b1 -text "CE" -font {times 14} -borderwidth 0
place $a4B.b1 -x 0 -y 160 -width 100 -height 50

button $a4B.b2 -text "C" -font {times 14} -borderwidth 0
place $a4B.b2 -x 105 -y 160 -width 100 -height 50

image create photo imgobj -file "C:/Vetri/Study/Skill-Lync/Automate using TCL-TK for Hypermesh/Week4/image.png"

button $a4B.b3 -image imgobj -font {times 4} -borderwidth 0
place $a4B.b3 -x 205 -y 160 -width 100 -height 50

button $a4B.b4 -text "÷" -font {times 15} -borderwidth 0
place $a4B.b4 -x 305 -y 160 -width 100 -height 50

button $a4B.b5 -text "7" -font {times 14} -borderwidth 0
place $a4B.b5 -x 0 -y 210 -width 100 -height 50

button $a4B.b6 -text "8" -font {times 14} -borderwidth 0
place $a4B.b6 -x 105 -y 210 -width 100 -height 50

button $a4B.b7 -text "9" -font {times 14} -borderwidth 0
place $a4B.b7 -x 205 -y 210 -width 100 -height 50

button $a4B.b8 -text "4" -font {times 14} -borderwidth 0
place $a4B.b8 -x 0 -y 260 -width 100 -height 50

button $a4B.b9 -text "5" -font {times 14} -borderwidth 0
place $a4B.b9 -x 105 -y 260 -width 100 -height 50

button $a4B.b10 -text "6" -font {times 14} -borderwidth 0
place $a4B.b10 -x 205 -y 260 -width 100 -height 50

button $a4B.b11 -text "3" -font {times 14} -borderwidth 0
place $a4B.b11 -x 0 -y 310 -width 100 -height 50

button $a4B.b12 -text "2" -font {times 14} -borderwidth 0
place $a4B.b12 -x 105 -y 310 -width 100 -height 50

button $a4B.b13 -text "1" -font {times 14} -borderwidth 0
place $a4B.b13 -x 205 -y 310 -width 100 -height 50

button $a4B.b14 -text "±" -font {times 14} -borderwidth 0
place $a4B.b14 -x 0 -y 360 -width 100 -height 50

button $a4B.b15 -text "0" -font {times 14} -borderwidth 0
place $a4B.b15 -x 105 -y 360 -width 100 -height 50

button $a4B.b16 -text "." -font {times 14} -borderwidth 0
place $a4B.b16 -x 205 -y 360 -width 100 -height 50

button $a4B.b17 -text "×" -font {times 15} -borderwidth 0
place $a4B.b17 -x 305 -y 210 -width 100 -height 50

button $a4B.b18 -text "-" -font {times 15} -borderwidth 0
place $a4B.b18 -x 305 -y 260 -width 100 -height 50

button $a4B.b19 -text "+" -font {times 15} -borderwidth 0
place $a4B.b19 -x 305 -y 310 -width 100 -height 50

button $a4B.b20 -text "=" -font {times 15} -borderwidth 0
place $a4B.b20 -x 305 -y 360 -width 100 -height 50
}
# ---------------------------------- Assignment-5 ---------------------------------------------
proc assign_5 {} {
*clearmarkall 1; *clearmarkall 2;

*setnormalsdisplaytype 1
*createmark elements 1 "displayed"
*normalsdisplay elements 1
*createmarkpanel elems 2

set a5 .window1
catch {destroy $a5}
toplevel $a5 -class TopLevel

wm title $a5 "Check Normals"
wm geometry $a5 250x150+650+150
wm resizable $a5 0 0

button $a5.01 -text "reverse normals" -font {times 11} -command { Rev_Normals; wm deiconify $a }
place $a5.01 -x 20 -y 40 -width 100 -height 25

button $a5.02 -text "normals off" -font {times 11} -command { Normals_off; wm deiconify $a }
place $a5.02 -x 130 -y 40 -width 100 -height 25
}

proc Rev_Normals { } {
set a [hm_getmark elems 2]
# puts $a
# puts [llength $a]
if {[llength $a] != 0} {
*normalsreverse elements 2
*createmark elements 1 "displayed"
*normalsdisplay elements 1
}
}

proc Normals_off { } {
*normalsoff
}

# ---------------------------------- Assignment-6 ---------------------------------------------
proc assign_6 {} {
*clearmarkall 1; *clearmarkall 2

set a6 .window1
catch {destroy $a6}
toplevel $a6 -class TopLevel

wm title $a6 "Final Checks"
wm geometry $a6 700x350+650+150
wm resizable $a6 0 0
wm deiconify $a6

# Delete Entities
label $a6.la1 -text "Delete Entities:" -font {times 12 bold}
place $a6.la1 -x 10 -y 20

button $a6.ba1 -text "Delete Solids" -command {Delete_Entities solids}
place $a6.ba1 -x 20 -y 50 -width 100 -height 25

button $a6.ba2 -text "Delete Surfs" -command {Delete_Entities surfs}
place $a6.ba2 -x 20 -y 85 -width 100 -height 25

button $a6.ba3 -text "Delete Lines" -command {Delete_Entities lines}
place $a6.ba3 -x 20 -y 120 -width 100 -height 25

button $a6.ba4 -text "Delete Points" -command {Delete_Entities points}
place $a6.ba4 -x 20 -y 155 -width 100 -height 25

button $a6.ba5 -text "Delete Elements" -command {Delete_Entities elements}
place $a6.ba5 -x 20 -y 190 -width 100 -height 25

button $a6.ba6 -text "Clear Nodes" -command {*nodecleartempmark}
place $a6.ba6 -x 20 -y 225 -width 100 -height 25

# Delete Empty
label $a6.lb1 -text "Delete Empty:" -font {times 12 bold}
place $a6.lb1 -x 150 -y 20

button $a6.bb1 -text "Components" -command {Delete_Empty comps}
place $a6.bb1 -x 160 -y 50 -width 100 -height 25

button $a6.bb2 -text "Assemblies" -command {Delete_Empty assems}
place $a6.bb2 -x 160 -y 85 -width 100 -height 25

# Delete Unused
label $a6.lc1 -text "Delete Unused:" -font {times 12 bold}
place $a6.lc1 -x 290 -y 20

button $a6.bc1 -text "Properties" -command {Delete_Unused props}
place $a6.bc1 -x 300 -y 50 -width 100 -height 25

button $a6.bc2 -text "Materials" -command {Delete_Unused mats}
place $a6.bc2 -x 300 -y 85 -width 100 -height 25

# Reorder
label $a6.ld1 -text "Reorder:" -font {times 12 bold}
place $a6.ld1 -x 430 -y 20

button $a6.bd1 -text "Components" -command {Reorder comps}
place $a6.bd1 -x 430 -y 50 -width 100 -height 25

button $a6.bd2 -text "Assemblies" -command {Reorder assems}
place $a6.bd2 -x 430 -y 85 -width 100 -height 25

button $a6.bd3 -text "Properties" -command {Reorder props}
place $a6.bd3 -x 430 -y 120 -width 100 -height 25

button $a6.bd4 -text "Materials" -command {Reorder mats}
place $a6.bd4 -x 430 -y 155 -width 100 -height 25

# Renumber
label $a6.le1 -text "Renumber:" -font {times 12 bold}
place $a6.le1 -x 570 -y 20

button $a6.be1 -text "Components" -command {Renumber comps}
place $a6.be1 -x 570 -y 50 -width 100 -height 25

button $a6.be2 -text "Assemblies" -command {Renumber assems}
place $a6.be2 -x 570 -y 85 -width 100 -height 25

button $a6.be3 -text "Properties" -command {Renumber props}
place $a6.be3 -x 570 -y 120 -width 100 -height 25

button $a6.be4 -text "Materials" -command {Renumber mats}
place $a6.be4 -x 570 -y 155 -width 100 -height 25

button $a6.be5 -text "Elements" -command {Renumber elems}
place $a6.be5 -x 570 -y 190 -width 100 -height 25

button $a6.be6 -text "Nodes" -command {Renumber nodes}
place $a6.be6 -x 570 -y 225 -width 100 -height 25

# master button
button $a6.bf1 -text "Master" -command {Master} -bg red -font {times 20 bold}
place $a6.bf1 -x 250 -y 250 -width 200 -height 55
}

proc Delete_Entities {type} {
if {$type == "solids"} {
*createmark $type 1 "displayed"
if {[hm_marklength $type 1] != 0} {
*deletesolidswithelems 1 1 1
puts "Displayed $type were deleted -solids"
} else {
puts "No $type were selected"
}
} elseif {$type == "surfs"} {
*createmark $type 1 "displayed"
if {[hm_marklength $type 1] != 0} {
*setoption delete_elements_mode=0
*deletemark $type 1
puts "Displayed $type were deleted -surfaces"
} else {
puts "No $type were selected"
}
} else {
*createmark $type 1 "displayed"
if {[hm_marklength $type 1] != 0} {
*deletemark $type 1
puts "Displayed $type were deleted"
} else {
puts "No $type were selected"
}
}
}

proc Delete_Empty {type} {
*EntityPreviewEmpty $type 1
if {[hm_marklength $type 1] != 0} {
*deletemark $type 1
puts "Empty $type were deleted"
} else {
puts "No $type were selected"
}
}

proc Delete_Unused {type} {
*EntityPreviewUnused $type 1
if {[hm_marklength $type 1] != 0} {
*deletemark $type 1
puts "Unused $type were deleted"
} else {
puts "No $type were selected"
}
}

proc Reorder {type} {
*createmark $type 1 "all"
if {[hm_marklength $type 1] !=0} {
*collectormarkmove $type 1 1 1
puts "All $type were sorted by name"
} else {
puts "No $type were selected"
}
}

proc Renumber {type} {
*createmark $type 1 "all"
if {[hm_marklength $type 1] !=0} {
*renumbersolverid $type 1 100 1 0 0 0 0 0
puts "All $type were renumbered"
} else {
puts "No $type were selected"
}
}

proc Master {} {
Delete_Entities solids
Delete_Entities surfs
Delete_Entities lines
Delete_Entities points
*nodecleartempmark

Delete_Empty comps
Delete_Empty assems

Delete_Unused props
Delete_Unused mats

Reorder comps
Reorder assems
Reorder props
Reorder mats

Renumber comps
Renumber assems
Renumber props
Renumber mats
Renumber mats
Renumber nodes
}

# ---------------------------------- Assignment-7 ---------------------------------------------
proc assign_7 {} {
*clearmarkall 1; *clearmarkall 2

set a7 .window1
catch {destroy $a7}
toplevel $a7 -class TopLevel

wm title $a7 "Free Edges Check"
wm geometry $a7 275x200+650+150
wm resizable $a7 0 0
wm deiconify $a7

label $a7.la1 -text "Display:" -font {times 12 bold}
place $a7.la1 -x 10 -y 20

button $a7.ba1 -text "Free Edges" -command {P_Free_Edges}
place $a7.ba1 -x 20 -y 50 -width 100 -height 25

button $a7.ba2 -text "T Edges" -command {P_T_Edges}
place $a7.ba2 -x 20 -y 85 -width 100 -height 25

button $a7.ba3 -text "Transparent" -command {P_Transparent}
place $a7.ba3 -x 20 -y 120 -width 100 -height 25

button $a7.bb1 -text "Equivalence" -command {P_Equivalence}
place $a7.bb1 -x 150 -y 50 -width 100 -height 25

button $a7.bb2 -text "Delete Edges" -command {P_Delete_Comp}
place $a7.bb2 -x 150 -y 85 -width 100 -height 25
}

proc P_Free_Edges {} {
*createmark elems 1 "displayed"
if {[hm_marklength elems 1] != 0} {
*findedges1 elems 1 0 0 0 0
*createmark comps 1 "^edges"
if {[hm_marklength comps 1] != 0} {
*renamecollector comps "^edges" "Free Edges"
*createmark comps 1 "Free Edges"
*colormark comps 1 3
} else {
puts "No free edges were found"
}
} else {
puts "No elements were selected"
}
}

# to display T-edges
proc P_T_Edges {} {
*createmark elems 1 "displayed"
if {[hm_marklength elems 1] != 0} {
*findedges1 elems 1 1 0 0 0
*createmark comps 1 "^edges"
if {[hm_marklength comps 1] != 0} {
*renamecollector comps "^edges" "T-edges"
*createmark comps 1 "T-edges"
*colormark comps 1 7
} else {
puts "No T-edges were found"
}
} else {
puts "No elements were selected"
}
}

# Except for edges, all other components must be made transparent
proc P_Transparent {} {
*createmark comps 1 "Free Edges" T-edges
if {[hm_marklength comps 1] != 0} {
hm_createmark comps 1 "advanced" "reverse"
*setmarkdisplayattributes comps 1 4 1
}
}

# Also, temp nodes must be automatically created for “free nodes” for a tolerance value of 0.01
proc P_Equivalence {} {
*createmark elems 1 "displayed"
if {[hm_marklength elems 1] != 0} {
*equivalence elems 1 0.01 3
hm_createmark nodes 1 "advanced" "retrieve"
*nodemarkaddtempmark 1
}
}

#Part B
proc P_Delete_Comp {} {
*createmark components 1 "Free Edges" "T-edges"
if {[hm_marklength comps 1] != 0} {
*deletemark components 1
*setdisplayattributes 2 1
}
}

# ---------------------------------- Assignment-8 ---------------------------------------------
proc assign_8 {} {
*clearmarkall 1; *clearmarkall 2
set ::c_name ""
set ::thick ""

set ::a8 .window1
catch {destroy $::a8}
toplevel $::a8 -class TopLevel

wm title $::a8 "Create Collector"
wm geometry $::a8 400x200+650+150
wm resizable $::a8 0 0
wm deiconify $::a8

label $::a8.la1 -text "Component Name:" -font {times 11}
place $::a8.la1 -x 20 -y 20

entry $::a8.ea1 -textvariable ::c_name
place $::a8.ea1 -x 150 -y 20 -width 150 -height 20

label $::a8.la2 -text "Thickness:" -font {times 11} -padx 49
place $::a8.la2 -x 20 -y 60

entry $::a8.ea2 -textvariable ::thick
place $::a8.ea2 -x 150 -y 60 -width 150 -height 20

button $::a8.ba1 -text "Create" -command {create_comp}
place $::a8.ba1 -x 150 -y 100 -width 50 -height 25
}

proc abaqus_proc {n t} {
set name "$n\_$t"
*createmark comps 1 "all"
if {[hm_marklength comps 1] !=0} {
set existing_comp [hm_getvalue comps mark=1 dataname=name]
if {$name in $existing_comp } {
tk_messageBox -message "Component name already exists" -icon warning -type ok -detail "Change the component name or thickness" -title "Warning!"
# wm deiconify $::a8
return
}
}
*createentity comps includeid=0 name=$name
*createmark comps 1 $name
set comp_id [hm_getmark comps 1]
*createentity props cardimage=SHELLSECTION includeid=0 name=$name
*createmark props 2 $name
set prop_id [hm_getmark props 2]
*setvalue props id=$prop_id STATUS=1 111=$t
*setvalue comps id=$comp_id propertyid={props $prop_id}
*createmark comps 1 $name
*autocolorwithmark components 1
*createmark props 2 $name
*autocolorwithmark props 2
}

proc lsdyna_proc {n t} {
set name "$n\_$t"
*createmark comps 1 "all"
if {[hm_marklength comps 1] !=0} {
set existing_comp [hm_getvalue comps mark=1 dataname=name]
if {$name in $existing_comp } {
tk_messageBox -message "Component name already exists" -icon warning -type ok -detail "Change the component name or thickness" -title "Warning!"
# wm deiconify $::a8
return
}
}
*createentity comps cardimage=Part includeid=0 name=$name
*createmark comps 1 $name
set comp_id [hm_getmark comps 1]
*createentity props cardimage=SectShll includeid=0 name=$name
*createmark props 2 $name
set prop_id [hm_getmark props 2]
*setvalue props id=$prop_id STATUS=2 457=0
*setvalue props id=$prop_id STATUS=1 431=$t
*setvalue comps id=$comp_id propertyid={props $prop_id}
*createmark comps 1 $name
*autocolorwithmark components 1
*createmark props 2 $name
*autocolorwithmark props 2
}

proc nastran_proc {n t} {
set name "$n\_$t"
*createmark comps 1 "all"
if {[hm_marklength comps 1] !=0} {
set existing_comp [hm_getvalue comps mark=1 dataname=name]
if {$name in $existing_comp } {
tk_messageBox -message "Component name already exists" -icon warning -type ok -detail "Change the component name or thickness" -title "Warning!"
# wm deiconify $::a8
return
}
}
*createentity comps includeid=0 name=$name
*createmark comps 1 $name
set comp_id [hm_getmark comps 1]
*createentity props cardimage=PSHELL includeid=0 name=$name
*createmark props 2 $name
set prop_id [hm_getmark props 2]
*setvalue props id=$prop_id STATUS=1 95=$t
*setvalue comps id=$comp_id propertyid={props $prop_id}
*createmark comps 1 $name
*autocolorwithmark components 1
*createmark props 2 $name
*autocolorwithmark props 2
}

proc pamcrash2g_proc {n t} {
set name "$n\_$t"
*createmark comps 1 "all"
if {[hm_marklength comps 1] !=0} {
set existing_comp [hm_getvalue comps mark=1 dataname=name]
if {$name in $existing_comp } {
tk_messageBox -message "Component name already exists" -icon warning -type ok -detail "Change the component name or thickness" -title "Warning!"
# wm deiconify $::a8
return
}
}
*createentity comps cardimage=PART_2D includeid=0 name=$name
*createmark comps 1 $name
set comp_id [hm_getmark comps 1]
*setvalue comps id=$comp_id STATUS=2 416=$t
*createmark comps 1 $name
*autocolorwithmark components 1
*createmark props 2 $name
*autocolorwithmark props 2
}

proc create_comp {} {
set user_profile [hm_info templatetype]
switch $user_profile {
abaqus { abaqus_proc $::c_name $::thick }
lsdyna { lsdyna_proc $::c_name $::thick }
nastran { nastran_proc $::c_name $::thick }
pamcrash2g { pamcrash2g_proc $::c_name $::thick }
}
}

# ---------------------------------- Assignment-9 ---------------------------------------------
proc assign_9 {} {
*clearmarkall 1; *clearmarkall 2

set ::o_geom ""
set ::t_geom ""
set ::o_fea ""
set ::comp_name_9 ""

set ::a9 .window1
catch {destroy $::a9}
toplevel $::a9 -class TopLevel

wm title $::a9 "Reflect "
wm geometry $::a9 400x200+650+150
wm resizable $::a9 0 0
wm deiconify $::a9

label $::a9.01 -text "Target Component:" -font {times 11}
place $::a9.01 -x 20 -y 20

entry $::a9.02 -textvariable ::comp_name_9
place $::a9.02 -x 150 -y 20 -width 150 -height 20

label $::a9.03 -text "Original Geometry:" -font {times 11}
place $::a9.03 -x 20 -y 50

button $::a9.04 -text select -font {times 11} -command {select "Select the original geometry" original; wm deiconify $::a9}
place $::a9.04 -x 150 -y 50 -width 100 -height 25

label $::a9.05 -text "Target Geometry:" -font {times 11}
place $::a9.05 -x 20 -y 80

button $::a9.06 -text select -font {times 11} -command {select "Select the target geometry" target; wm deiconify $::a9}
place $::a9.06 -x 150 -y 80 -width 100 -height 25

label $::a9.07 -text "Original FE:" -font {times 11}
place $::a9.07 -x 20 -y 110

button $::a9.08 -text select -font {times 11} -command {select "Select the original components with FE elements" FE; wm deiconify $::a9}
place $::a9.08 -x 150 -y 110 -width 100 -height 25

button $::a9.09 -text reflect -font {times 12 bold} -command {reflect}
place $::a9.09 -x 130 -y 150 -width 140 -height 30
}

proc reflect {} {
# creating components and copying elements to the components
if {$::o_geom != "" && $::t_geom != "" && $::o_fea != "" && $::comp_name_9 != ""} {
set user_profile [hm_info templatetype]
set select_profile {abaqus lsdyna nastran pamcrash2g}
if {$user_profile in $select_profile} {
foreach i $::o_fea {
set t [hm_getthickness comps $i]
set o_name [hm_getvalue comps id=$i dataname=name]
set n_name "$::comp_name_9\_$t"
switch $user_profile {
abaqus { abaqus_proc $::comp_name_9 $t }
lsdyna { lsdyna_proc $::comp_name_9 $t }
nastran { nastran_proc $::comp_name_9 $t }
pamcrash2g { pamcrash2g_proc $::comp_name_9 $t }
}
*createmark elems 1 $o_name
*copymark elems 1 $n_name
*createmark elems 1 $o_name
*maskentitymark elems 1 0
}
} else {
tk_messageBox -message "Change the user profile" -icon warning -type ok -title "Warning!"
return
}

*clearmarkall 1; *clearmarkall 2;
*createmark comps 1 "displayed"
*autocolorwithmark comps 1

*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]
*createmarklast nodes 1
set o_node [hm_getmark nodes 1]

*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]
*createmarklast nodes 2
set t_node [hm_getmark nodes 2]

set intercepts [hm_getdistance nodes $o_node $t_node 0]
*clearmarkall 1; *clearmarkall 2;
*createnodesbetweennodes $o_node $t_node 1
*createmark nodes 1 -1
set m_node [hm_getmark nodes 1]
set m_node_info [hm_getvalue nodes id=$m_node dataname=coordinates]

*clearmarkall 1
*createmark elems 1 "displayed"
*createplane 1 [lindex $intercepts 1] [lindex $intercepts 2] [lindex $intercepts 3] [lindex $m_node_info 0] [lindex $m_node_info 1] [lindex $m_node_info 2]
*reflectmarkwithoption elems 1 1 0;

*clearmarkall 1; *clearmarkall 2;
*createmark comps 1 "displayed"
*equivalence comps 1 0.01 1 0 0

*displaycollectorwithfilter components "none" "" 1 0
*displaycollectorwithfilter components "all" "" 1 0
}
}

proc select {help flag} {
*clearmarkall 1; *clearmarkall 2

*createmarkpanel comps 1 $help
switch $flag {
original {set ::o_geom [hm_getmark comp 1]}
target {set ::t_geom [hm_getmark comp 1]}
FE {set ::o_fea [hm_getmark comps 1]}
}
*clearmarkall 1
}

# ---------------------------------- Assignment-10 ---------------------------------------------
proc assign_10A {} {
*clearmarkall 1; *clearmarkall 2

set ::list_A ""
set ::list_B ""

set ::a10A .window1
catch {destroy $::a10A}
toplevel $::a10A -class TopLevel

wm title $::a10A "Midline "
wm geometry $::a10A 300x200+650+150
wm resizable $::a10A 0 0
wm deiconify $::a10A

button $::a10A.01 -text "line path 1" -font {times 11} -command {select_entity lines 1; wm deiconify $::a10A}
place $::a10A.01 -x 45 -y 30 -width 100 -height 25

button $::a10A.02 -text "line path 2" -font {times 11} -command {select_entity lines 2; wm deiconify $::a10A}
place $::a10A.02 -x 155 -y 30 -width 100 -height 25

button $::a10A.03 -text "create" -font {times 12} -command {midline}
place $::a10A.03 -x 100 -y 80 -width 100 -height 30
}

proc select_entity {entity x} {

*createlistbypathpanel $entity 1 "Select edge 1"
switch $x {
1 {set ::list_A [hm_getlist $entity 1]}
2 {set ::list_B [hm_getlist $entity 1]}
}
}

proc midline {} {

if {[llength $::list_A] != 0 && [llength $::list_B] != 0} {
if {[llength $::list_A] == [llength $::list_B]} {
foreach line_A $::list_A \
line_B $::list_B {

*createlist lines 1 $line_A
*createlist nodes 1
*createlist lines 2 $line_B
*createlist nodes 2
*linescreatemidline 1 1 2 2

*createmark lines 1 -1
lappend mid_line [hm_getmark lines 1]
}

*clearmarkall 1; *clearmarkall 2
eval *createmark lines 1 $mid_line
*linecombinemark 1 0.1 30 0

} else {puts "Selected line lists are not equal"}
} else {puts "Select both the line lists"}
}

proc assign_10B {} {
*clearmarkall 1; *clearmarkall 2

set ::list_A ""
set ::list_B ""

set ::a10B .window1
catch {destroy $::a10B}
toplevel $::a10B -class TopLevel

wm title $::a10B "Spot weld "
wm geometry $::a10B 300x200+650+150
wm resizable $::a10B 0 0
wm deiconify $::a10B

button $::a10B.01 -text "node path 1" -font {times 11} -command {select_entity nodes 1; wm deiconify $::a10B}
place $::a10B.01 -x 45 -y 30 -width 100 -height 25

button $::a10B.02 -text "node path 2" -font {times 11} -command {select_entity nodes 2; wm deiconify $::a10B}
place $::a10B.02 -x 155 -y 30 -width 100 -height 25

button $::a10B.03 -text "create" -font {times 12} -command {spot_weld}
place $::a10B.03 -x 100 -y 80 -width 100 -height 30
}

proc spot_weld {} {

if {[llength $::list_A] != 0 && [llength $::list_B] != 0} {
if {[llength $::list_A] == [llength $::list_B]} {
foreach node_A $::list_A \
node_B $::list_B {
*rigid $node_A $node_B 123456
}
} else {puts "Selected node lists are not equal"}
} else {puts "Select both the node lists"}
}

# ---------------------------------- Assignment-11 ---------------------------------------------
proc assign_11 {} {

foreach x {::min_fail ::max_fail ::w_fail ::ar_fail ::s_fail ::j_fail ::tmin_fail ::tmax_fail ::qmin_fail ::qmax_fail} {
set $x ""
}

set a11 .window1
catch {destroy $a11}
toplevel $a11 -class TopLevel

wm title $a11 "Element Quality Check"
wm geometry $a11 400x500+650+150
wm resizable $a11 0 0
wm deiconify $a11

# ----------------- a ---------------------
label $a11.la1 -text "2D Checks"
place $a11.la1 -x 30 -y 20

label $a11.la2 -text "Thershold"
place $a11.la2 -x 120 -y 20

label $a11.la3 -text "Failed Elements"
place $a11.la3 -x 225 -y 20

# ----------------- b ---------------------
button $a11.bb1 -text "Min Length" -command {2D_check length 1 0}
place $a11.bb1 -x 10 -y 50 -width 80

label $a11.lb2 -text "<"
place $a11.lb2 -x 100 -y 50

set ::min_value 3.0
entry $a11.eb3 -textvariable ::min_value
place $a11.eb3 -x 120 -y 50 -width 50

entry $a11.eb4 -textvariable ::min_fail -state disabled
place $a11.eb4 -x 235 -y 50 -width 50

# entry $a11.eb5 -textvariable ::min_fail_pt -state readonly
# place $a11.eb5 -x 360 -y 50 -width 50

# ----------------- c ---------------------
button $a11.bc1 -text "Max Length" -command {2D_check length 0 0}
place $a11.bc1 -x 10 -y 75 -width 80

label $a11.lc2 -text ">"
place $a11.lc2 -x 100 -y 75

set ::max_value 10.0
entry $a11.ec3 -textvariable ::max_value
place $a11.ec3 -x 120 -y 75 -width 50

entry $a11.ec4 -textvariable ::max_fail -state disabled
place $a11.ec4 -x 235 -y 75 -width 50

# entry $a11.ec5 -textvariable ::max_fail_pt -state readonly
# place $a11.ec5 -x 360 -y 75 -width 50

# ----------------- d ---------------------
button $a11.bd1 -text "Warpage" -command {2D_check warpage 0 0}
place $a11.bd1 -x 10 -y 100 -width 80

label $a11.ld2 -text ">"
place $a11.ld2 -x 100 -y 100

set ::w_value 5.0
entry $a11.ed3 -textvariable ::w_value
place $a11.ed3 -x 120 -y 100 -width 50

entry $a11.ed4 -textvariable ::w_fail -state disabled
place $a11.ed4 -x 235 -y 100 -width 50

# entry $a11.ed5 -textvariable ::w_fail_pt -state readonly
# place $a11.ed5 -x 360 -y 100 -width 50

# ----------------- e ---------------------
button $a11.be1 -text "Aspect" -command {2D_check aspect 0 0}
place $a11.be1 -x 10 -y 125 -width 80

label $a11.le2 -text ">"
place $a11.le2 -x 100 -y 125

set ::ar_value 5.0
entry $a11.ee3 -textvariable ::ar_value
place $a11.ee3 -x 120 -y 125 -width 50

entry $a11.ee4 -textvariable ::ar_fail -state disabled
place $a11.ee4 -x 235 -y 125 -width 50

# entry $a11.ee5 -textvariable ::ar_fail_pt -state readonly
# place $a11.ee5 -x 360 -y 125 -width 50

# ----------------- f ---------------------
button $a11.bf1 -text "Skew" -command {2D_check skew 0 0}
place $a11.bf1 -x 10 -y 150 -width 80

label $a11.lf2 -text ">"
place $a11.lf2 -x 100 -y 150

set ::s_value 50.0
entry $a11.ef3 -textvariable ::s_value
place $a11.ef3 -x 120 -y 150 -width 50

entry $a11.ef4 -textvariable ::s_fail -state disabled
place $a11.ef4 -x 235 -y 150 -width 50

# ----------------- g ---------------------
button $a11.bg1 -text "Jacobian" -command {2D_check jacobian 0 0}
place $a11.bg1 -x 10 -y 175 -width 80

label $a11.lg2 -text ">"
place $a11.lg2 -x 100 -y 175

set ::j_value 0.7
entry $a11.eg3 -textvariable ::j_value
place $a11.eg3 -x 120 -y 175 -width 50

entry $a11.eg4 -textvariable ::j_fail -state disabled
place $a11.eg4 -x 235 -y 175 -width 50

# ----------------- h ---------------------
label $a11.bh1 -text "trias:"
place $a11.bh1 -x 10 -y 200

# ----------------- i ---------------------
button $a11.bi1 -text "min angle" -command {2D_check interangle 1 1}
place $a11.bi1 -x 10 -y 215 -width 80

label $a11.li2 -text "<"
place $a11.li2 -x 100 -y 215

set ::tmin_value 35.0
entry $a11.ei3 -textvariable ::tmin_value
place $a11.ei3 -x 120 -y 215 -width 50

entry $a11.ei4 -textvariable ::tmin_fail -state disabled
place $a11.ei4 -x 235 -y 215 -width 50

# ----------------- j ---------------------
button $a11.bj1 -text "max angle" -command {2D_check interangle 0 1}
place $a11.bj1 -x 10 -y 240 -width 80

label $a11.lj2 -text ">"
place $a11.lj2 -x 100 -y 240

set ::tmax_value 90.0
entry $a11.ej3 -textvariable ::tmax_value
place $a11.ej3 -x 120 -y 240 -width 50

entry $a11.ej4 -textvariable ::tmax_fail -state disabled
place $a11.ej4 -x 235 -y 240 -width 50

# ----------------- k ---------------------
label $a11.bk1 -text "quads:"
place $a11.bk1 -x 10 -y 265

# ----------------- l ---------------------
button $a11.bl1 -text "min angle" -command {2D_check interangle 1 0}
place $a11.bl1 -x 10 -y 280 -width 80

label $a11.ll2 -text "<"
place $a11.ll2 -x 100 -y 280

set ::qmin_value 45.0
entry $a11.el3 -textvariable ::qmin_value
place $a11.el3 -x 120 -y 280 -width 50

entry $a11.el4 -textvariable ::qmin_fail -state disabled
place $a11.el4 -x 235 -y 280 -width 50

# ----------------- m ---------------------
button $a11.bm1 -text "max angle" -command {2D_check interangle 0 0}
place $a11.bm1 -x 10 -y 305 -width 80

label $a11.lm2 -text ">"
place $a11.lm2 -x 100 -y 305

set ::qmax_value 135.0
entry $a11.em3 -textvariable ::qmax_value
place $a11.em3 -x 120 -y 305 -width 50

entry $a11.em4 -textvariable ::qmax_fail -state disabled
place $a11.em4 -x 235 -y 305 -width 50

# ----------------- end ---------------------
button $a11.bz1 -text "Clear nodes" -command {*nodecleartempmark}
place $a11.bz1 -x 300 -y 450 -width 80
}

proc 2D_check {criteria range element_type} {
# set criteria {min_length max_length warpage aspect skew jacobian tmin_angle tmax_angle qmin_angle qmax_angle}
# set criteria_value {::min_value ::max_value ::w_value ::ar_value ::s_value ::j_value ::tmin_value ::tmax_value ::qmin_value ::qmax_value}
# set fail {::min_fail ::max_fail ::w_fail ::ar_fail ::s_fail ::j_fail ::tmin_fail ::tmax_fail ::qmin_fail ::qmax_fail}

# puts "$criteria $range $element_type"

*clearmark all 1; *clearmarkall 2
*createmark elems 1 "all"
if {[hm_marklength elems 1] != 0} {
switch $criteria {
length { if {$range == 1} {*elementtest$criteria elems 1 $::min_value 2 $range 2 0}
if {$range == 0} {*elementtest$criteria elems 1 $::max_value 2 $range 2 0}
}
interangle { if {$element_type == 1 && $range == 1} {*elementtest$criteria elems 1 $::tmin_value $element_type 2 $range 2 0}
if {$element_type == 1 && $range == 0} {*elementtest$criteria elems 1 $::tmax_value $element_type 2 $range 2 0}
if {$element_type == 0 && $range == 1} {*elementtest$criteria elems 1 $::qmin_value $element_type 2 $range 2 0}
if {$element_type == 0 && $range == 0} {*elementtest$criteria elems 1 $::qmax_value $element_type 2 $range 2 0}
}
warpage {*elementtest$criteria elems 1 $::w_value 2 2 0}
aspect {*elementtest$criteria elems 1 $::ar_value 2 2 0}
skew {*elementtest$criteria elems 1 $::s_value 2 2 0}
jacobian {*elementtest$criteria elems 1 $::j_value 2 2 0}
}

*maskentitymark elems 2
*maskreverse elems
*createmark nodes 1 "displayed"
if {[hm_marklength nodes 1] != 0} {
*nodemarkaddtempmark 1
*createmark elems 1 "displayed"

switch $criteria {
foreach x {::min_fail ::max_fail ::w_fail ::ar_fail ::s_fail ::j_fail ::tmin_fail ::tmax_fail ::qmin_fail ::qmax_fail} {
set $x ""
}

length {if {$range == 1} {set ::min_fail [hm_marklength elems 1]}
if {$range == 0} {set ::max_fail [hm_marklength elems 1]}
}
interangle {if {$element_type == 1 && $range == 1} {set ::tmin_fail [hm_marklength elems 1]}
if {$element_type == 1 && $range == 0} {set ::tmax_fail [hm_marklength elems 1] }
if {$element_type == 0 && $range == 1} {set ::qmin_fail [hm_marklength elems 1]}
if {$element_type == 0 && $range == 0} {set ::qmax_fail [hm_marklength elems 1]}
}
warpage {set ::w_fail [hm_marklength elems 1]}
aspect {set ::ar_fail [hm_marklength elems 1]}
skew {set ::s_fail [hm_marklength elems 1]}
jacobian {set ::j_fail [hm_marklength elems 1]}

}
}
}
*unmaskall 2
}

# ---------------------------------- Assignment-12 ---------------------------------------------
proc assign_12A {} {

set a12A .window1
catch {destroy $a12A}
toplevel $a12A -class TopLevel

wm title $a12A "Create Connector"
wm geometry $a12A 250x300+650+150
wm resizable $a12A 0 0
wm deiconify $a12A

button $a12A.b1 -text "Create Components" -command {New_Comp} -font {times 12}
place $a12A.b1 -x 40 -y 20 -width 160 -height 30

button $a12A.b2 -text "weld" -command {weld_proc} -font {times 12}
place $a12A.b2 -x 40 -y 60 -width 160 -height 30

button $a12A.b3 -text "x-loc" -command {locator x-loc 156} -font {times 12}
place $a12A.b3 -x 40 -y 100 -width 160 -height 30

button $a12A.b4 -text "y-loc" -command {locator y-loc 246} -font {times 12}
place $a12A.b4 -x 40 -y 140 -width 160 -height 30

button $a12A.b5 -text "z-loc" -command {locator z-loc 345} -font {times 12}
place $a12A.b5 -x 40 -y 180 -width 160 -height 30
}

proc New_Comp {} {
*clearmark all 1; *clearmarkall 2
*createmark comps 1 "all"
if {[hm_marklength comps 1] == 0} {
set comp_names "none"
} else {
set comp_ids [hm_getmark comps 1]
foreach i $comp_ids {
lappend comp_names [hm_getvalue comps id=$i dataname=name]
}
}

foreach j {weld x-loc y-loc z-loc} {
if {$j in $comp_names} {
puts "$j already exists in the model"
} else {
*createentity comps cardimage=Part includeid=0 name=$j
}
}
}

proc weld_proc {} {
*clearmark all 1; *clearmarkall 2
*createmarkpanel nodes 1 "Select the nodes for creating spider weld"
if {[hm_marklength nodes 1] !=0} {
*currentcollector components "weld"
*rigidlinkinodecalandcreate 1 0 0 123456
*clearmark all 1
}
*clearmark all 1
}

proc locator {current_comp dof} {
*clearmark all 1; *clearmarkall 2
*createmarkpanel nodes 1 "Select the master nodes"
if {[hm_marklength nodes 1] !=0} {
set master [hm_getmark nodes 1]
*createmarkpanel nodes 2 "Select the slave nodes"
if {[hm_marklength nodes 2] !=0} {
set slave [hm_getmark nodes 2]
if {[llength $master] == [llength $slave]} {
*currentcollector components $current_comp
foreach node1 $master \
node2 $slave {
*rigid $node1 $node2 $dof
}
} else {puts "select master and slave nodes of same length"}
} else {puts "select atleast one slave nodes"}
} else {puts "select atleast one master nodes"}
}

proc assign_12B {} {
set ::file_name ""
*clearmarkall 1; *clearmarkall 2

set a12B .window
catch {destroy $a12B}
toplevel $a12B -class TopLevel

wm title $a12B "Create nodes from file"
wm geometry $a12B 300x200+650+150
wm resizable $a12B 0 0
wm deiconify $a12B

label $a12B.la1 -text "File name:"
place $a12B.la1 -x 20 -y 20

entry $a12B.e2 -textvariable ::file_name
place $a12B.e2 -x 80 -y 20 -height 20

button $a12B.b3 -text "write nodes" -command {write_nodes} -bg red
place $a12B.b3 -x 80 -y 50 -width 100 -height 25

button $a12B.b4 -text "read nodes" -command {read_nodes} -bg green
place $a12B.b4 -x 80 -y 120 -width 100 -height 25
}

proc write_nodes {} {
*clearmarkall 1; *clearmarkall 2
*createmarkpanel nodes 1 "Select Nodes"
if {[hm_marklength nodes 1] != 0} {
set selected_nodes [hm_getmark nodes 1]
set write_file [open $::file_name w]
foreach i $selected_nodes {
set info [hm_getvalue nodes id=$i dataname=coordinates]
puts $write_file $info
}
close $write_file
}
}

proc read_nodes {} {
*clearmarkall 1; *clearmarkall 2
set get_file [tk_getOpenFile]
if {$get_file != ""} {
set read_file [open $get_file r]
while {[eof $read_file] == 0} {
gets $read_file node_info
*createentity nodes coordinates={[lindex $node_info 0] [lindex $node_info 1] [lindex $node_info 2]}
# puts $node_info
}
close $read_file
}
}

proc assign_12C {} {
*clearmarkall 1; *clearmarkall 2
# list all components
*createmark comps 1 "all"
if {[hm_marklength comps 1] != 0} {
set all_comps [hm_getmark comps 1]
}

# count no of surfaces
foreach i $all_comps {
*createmark surfs 1 "by collector" $i
lappend surf_count [hm_marklength surfs 1]
}
# select a component
*clearmarkall 1; *clearmarkall 2
*createmarkpanel comps 1 "Select a geometric component"
if {[hm_marklength comps 1] != 0} {
set target_comp [hm_getmark comps 1]
*isolateentitybymark 1
*createmark surfs 2 "by collector" $target_comp
set target_surf [hm_marklength surfs 2]

set match_list [lsearch -all $surf_count $target_surf]

foreach j $match_list {
set comp_id [lindex $all_comps $j]
*createmark comps 1 $comp_id
*displaycollectorsbymark comps 1 on 0 1
}
}
}
# ---------------------------------- Procedures-End ---------------------------------------------

# ---------------------------------- Main Window ---------------------------------------------

*clearmarkall 1; *clearmarkall 2
set a .window
catch {destroy $a}
toplevel $a -class TopLevel

wm title $a "Master macro"
wm geometry $a 600x650+100+100
wm resizable $a 0 0
wm deiconify $a

button $a.b02 -text "Factorial" -font {times 12} -command {assign_2}
place $a.b02 -x 30 -y 20 -width 120 -height 30

label $a.l02 -font {times 10} -text "Calculates the factorials for the given numbers"
place $a.l02 -x 170 -y 25

button $a.b03 -text "Delete Elements" -font {times 12} -command {assign_3}
place $a.b03 -x 30 -y 60 -width 120 -height 30

label $a.l03 -font {times 10} -text "Deletes the selected elements and displays the corresponding components"
place $a.l03 -x 170 -y 65

button $a.b04 -text "Calculator" -font {times 12} -command {assign_4}
place $a.b04 -x 30 -y 100 -width 120 -height 30

label $a.l04 -font {times 10} -text "Performs addition and substraction on the given numbers"
place $a.l04 -x 170 -y 105

button $a.b05 -text "Check Normals" -font {times 12} -command {assign_5}
place $a.b05 -x 30 -y 140 -width 120 -height 30

label $a.l05 -font {times 10} -text "Checks and correct the normals of the displayed elements"
place $a.l05 -x 170 -y 145

button $a.b06 -text "Final Checks" -font {times 12} -command {assign_6}
place $a.b06 -x 30 -y 180 -width 120 -height 30

label $a.l06 -font {times 10} -wraplength 410 -text "Deletes the displayed geometric entities, empty and unused entities, renumber and reorder entities" -justify left
place $a.l06 -x 170 -y 180

button $a.b07 -text "Check Edges" -font {times 12} -command {assign_7}
place $a.b07 -x 30 -y 220 -width 120 -height 30

label $a.l07 -font {times 10} -text "Checks and corrects free and T-edges"
place $a.l07 -x 170 -y 225

button $a.b08 -text "Create Collectors" -font {times 12} -command {assign_8}
place $a.b08 -x 30 -y 260 -width 120 -height 30

label $a.l08 -font {times 10} -text "Create components and assign thickness"
place $a.l08 -x 170 -y 265

button $a.b09 -text "Reflect FE" -font {times 12} -command {assign_9}
place $a.b09 -x 30 -y 300 -width 120 -height 30

label $a.l09 -font {times 10} -text "Reflects the multicomponent FE part into its respective components"
place $a.l09 -x 170 -y 305

button $a.b10A -text "Midline" -font {times 12} -command {assign_10A}
place $a.b10A -x 30 -y 340 -width 120 -height 30

label $a.l10A -font {times 10} -text "Creates midline of a given tubular components"
place $a.l10A -x 170 -y 345

button $a.b10B -text "Spot weld" -font {times 12} -command {assign_10B}
place $a.b10B -x 30 -y 380 -width 120 -height 30

label $a.l10B -font {times 10} -text "Creates spot welds for the selected nodes"
place $a.l10B -x 170 -y 385

button $a.b11 -text "Quality Check" -font {times 12} -command {assign_11}
place $a.b11 -x 30 -y 420 -width 120 -height 30

label $a.l11 -font {times 10} -wraplength 410 -text "Check the element quality for 2D and 3D elements based on the user input criteria" -justify left
place $a.l11 -x 170 -y 420

button $a.b12A -text "Connector" -font {times 12} -command {assign_12A}
place $a.b12A -x 30 -y 460 -width 120 -height 30

label $a.l12A -font {times 10} -text "Creates spider weld, spot weld, and x,y,z locators"
place $a.l12A -x 170 -y 465

button $a.b12B -text "Read Nodes" -font {times 12} -command {assign_12B}
place $a.b12B -x 30 -y 500 -width 120 -height 30

label $a.l12B -font {times 10} -text "Create nodes on the co-ordinates obtained from a file"
place $a.l12B -x 170 -y 505

button $a.b12C -text "Find Identical" -font {times 12} -command {assign_12C}
place $a.b12C -x 30 -y 540 -width 120 -height 30

label $a.l12C -font {times 10} -text "Isolates the identical geometries"
place $a.l12C -x 170 -y 545

Conclusion:

A GUI with buttons were created, each buttons were linked to a utility. On clicking the corresponding button, required process could be performed

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.

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.