All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Objective: To create code for creating midline and combine the line. Create spotweld for given set of node Procedure: MIDLINE: 1. Create a set for storing first set of lines 2. Create a set for storing second set of lines 3. creating midline for every pair of lines 4. combining lines to single line Code: *createlistbypathpanel…
dinesh reddy
updated on 18 Mar 2023
Objective: To create code for creating midline and combine the line. Create spotweld for given set of node
Procedure:
MIDLINE:
1. Create a set for storing first set of lines
2. Create a set for storing second set of lines
3. creating midline for every pair of lines
4. combining lines to single line
Code:
*createlistbypathpanel lines 1 "Select first set of lines"
set first [hm_getlist lines 1]
*createlistbypathpanel lines 1 "Select second set of lines"
set second [hm_getlist lines 1]
set mid {}
foreach i $first j $second {
*clearmarkall 1; *clearmarkall 2
*createlist lines 1 $i
*createlist nodes 1
*createlist lines 2 $j
*createlist nodes 2
*linescreatemidline 1 1 2 2
set b [hm_latestentityid lines]
lappend mid $b
if {[llength $mid] > 1} {
*linecombine [lindex $mid 0] [lindex $mid 1] 0
set mid [hm_latestentityid lines]
}
}
Rigids:
1. Create a set for storing first set of nodes
2. Create a set for storing second set of nodes
3. creating rigids for every pair of nodes
Code:
*createlistbypathpanel nodes 1 "Select first set of nodes"
set first [hm_getlist nodes 1]
*createlistbypathpanel nodes 1 "Select second set of nodes"
set second [hm_getlist nodes 1]
set mid {}
foreach i $first j $second {
*clearmarkall 1; *clearmarkall 2
*elementtype 5 1
*rigid $i $j 123456
}
Conclusion:
Full code combing midline and rigids
proc midline {} {
*createlistbypathpanel lines 1 "Select first set of lines"
set first [hm_getlist lines 1]
*createlistbypathpanel lines 1 "Select second set of lines"
set second [hm_getlist lines 1]
set mid {}
foreach i $first j $second {
*clearmarkall 1; *clearmarkall 2
*createlist lines 1 $i
*createlist nodes 1
*createlist lines 2 $j
*createlist nodes 2
*linescreatemidline 1 1 2 2
set b [hm_latestentityid lines]
lappend mid $b
if {[llength $mid] > 1} {
*linecombine [lindex $mid 0] [lindex $mid 1] 0
set mid [hm_latestentityid lines]
}
}
}
proc rigids {} {
*createlistbypathpanel nodes 1 "Select first set of nodes"
set first [hm_getlist nodes 1]
*createlistbypathpanel nodes 1 "Select second set of nodes"
set second [hm_getlist nodes 1]
set mid {}
foreach i $first j $second {
*clearmarkall 1; *clearmarkall 2
*elementtype 5 1
*rigid $i $j 123456
}
}
set a .window
catch {destroy $a}
toplevel $a -class Toplevel
wm title $a "Midline_Rigids"
wm geometry $a 200x200+500+500
wm resizable $a 0 0
wm deiconify $a
button $a.01 -text "Midline" -command {midline} -font {time 11}; place $a.01 -x 45 -y 15
button $a.02 -text "Rigids" -command {rigids} -font {time 11}; place $a.02 -x 45 -y 60
Successfully run in hypermesh
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week - 11 - Element quality check
Objective: To create a code to show the failed elements based on quality criteria Procedure: 1. create tk gui to get the quality criteria 2. using the criteria get failed elements and add temp node to highlight them verifying Code: # need to add a way to display number of failed elementsset a .windowcatch {destroy $a}toplevel…
23 Mar 2023 09:06 AM IST
Week - 9 - Reflecting the geometry
Objective: To create a code to reflect elements for similar components and create components for them and properties depending on solver type Procedure: 1. Provide the name for reflected components elements 2. Select source geometry 3. Select reflect to geometry 4. Select fe of components to be reflected 5. get centroid…
22 Mar 2023 03:30 PM IST
Week - 10 - Creating the midline and spot weld
Objective: To create code for creating midline and combine the line. Create spotweld for given set of node Procedure: MIDLINE: 1. Create a set for storing first set of lines 2. Create a set for storing second set of lines 3. creating midline for every pair of lines 4. combining lines to single line Code: *createlistbypathpanel…
18 Mar 2023 05:44 PM IST
Week - 8 - Creating component and property
Objective: To create code to create collector of component and property with thickness given by user and assign it to component based on solver type Procedure: 1. Get the user input of component type and thickness from tk window 2. create a component and property with user given name and assign property to given component…
18 Mar 2023 01:26 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.