Week - 10 - Creating the midline and spot weld
*# Create a panel to select the first line that will define the mid-line
# Then save it in variable a
*createlistbypathpanel lines 1 "Select the first line to build the mid-line"
set a [hm_getlist lines 1]
# Create a panel to select the second line that will define the mid-line
# Then save it in variable b
*createlistbypathpanel lines 2 "Select the second line to build the mid-line"
set b [hm_getlist lines 2]
# Create the component to store the rigid elements
*createentity comps cardimage=Part name=Mid_line
# Create empty node lists to construct midlines
*createlist nodes 1
*createlist nodes 2
# Create foreach loop to pair lines to create mid-line
foreach i $a j $b {
*createlist lines 1 $i
*createlist lines 2 $j
*linescreatemidline 1 1 2 2
}
# Create mark to refer to all lines saved in the "Mid-line" component
*createmark lines 1 "by comp" Mid_line
*linecombinemark 1 0.1 60 0
# Create a panel to select the first list of ordered nodes that will define the weld-line
# Then save it in variable a
*createlistbypathpanel nodes 1 "Select the first path of nodes where you want the welds to pass through"
set a [hm_getlist nodes 1]
# Create a panel to select the second list of ordered nodes that will define the weld-line
# Then save it in variable b
*createlistbypathpanel nodes 2 "Select the second path of nodes where you want the welds to pass through"
set b [hm_getlist nodes 2]
# Create the component to store the rigid elements
*createentity comps cardimage=Part name=Rigids
# Run the foreach command to create element by element by pairing each node of list "a" to its
# corresponding node in list "b"
foreach i $a j $b {
*rigid $i $j 123456
}