All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To create a macro for generating the report for hypermesh file. CODE: # getting username, date and time!*clearmarkall 1*clearmarkall 2set filename [open Output.csv w]set systemname "$env(COMPUTERNAME)"puts $filename "USERNAME-$systemname"puts $filename [clock format [clock seconds]] # finding the number of component,…
Vivek Sant
updated on 07 Feb 2022
AIM: To create a macro for generating the report for hypermesh file.
CODE:
# getting username, date and time!*clearmarkall 1
*clearmarkall 2
set filename [open Output.csv w]
set systemname "$env(COMPUTERNAME)"
puts $filename "USERNAME-$systemname"
puts $filename [clock format [clock seconds]]
# finding the number of component, properties and material and elements
set profile [ hm_info templatetype]
puts $filename "Current Profile = $profile"
*createmark comp 1 "all"
set comp [hm_getmark comp 1]
set n_comp [llength $comp]
puts $filename "No of Components = $n_comp "
*createmark prop 1 "all"
set prop [hm_getmark prop 1]
set n_prop [llength $prop]
puts $filename "No of Properties = $n_prop "
*createmark mat 1 "all"
set mat [hm_getmark mat 1]
set n_mat [llength $mat]
puts $filename "No of Materials = $n_mat "
*createmark elems 1 "all"
set elems [hm_getmark elems 1]
set n_elems [llength $elems]
*createmark elems 1 "by config" quad4
set n_quad [hm_marklength elems 1]
*createmark elems 1 "by config" tria3
set n_tria [hm_marklength elems 1]
puts $filename "No of QUAD Elements t $n_quad "
puts $filename "No of TRIA Elements t $n_tria "
puts $filename "TOtal No of Elements t $n_elems "
# finding number of empty component, properties and material
*EntityPreviewEmpty comps 1
set comp1 [hm_marklength comps 1]
set a1 [hm_getmark comps 1]
puts $filename "No of Empty Comps - $comp1"
*EntityPreviewUnused prop 1
set p1 [hm_marklength prop 1]
set b1 [hm_getmark prop 1]
puts $filename "No of Unused Properties - $p1"
*EntityPreviewUnused mat 1
set m1 [hm_marklength mat 1]
set c1 [hm_getmark mat 1]
puts $filename "No of Unused Materials - $m1"
# ElementQuality check
set minlength {2}
*createmark elems 1 "all"
*elementtestlength elems 1 $minlength 2 1 2 0 "2D length <"
set minfail [hm_marklength elems 2]
set maxlength {8}
*createmark elems 1 "all"
*elementtestlength elems 1 $maxlength 2 0 2 0 "2D length >"
set maxfail [hm_marklength elems 2]
set skew {60}
*createmark elems 1 "all"
*elementtestskew elements 1 $skew 2 2 0 " 2D Skew "
set skewe [hm_marklength elems 2]
set jacobian {0.5}
*createmark elems 1 "all"
*elementtestjacobian elements 1 $jacobian 2 2 0 " 2D Jacobian "
set jacobiane [hm_marklength elems 2]
set triaminangle {20}
*createmark elems 1 "all"
*elementtestinterangle elements 1 $triaminangle 1 2 1 2 0 " 2D Tria Min Angle "
set triamine [hm_marklength elems 2]
set triamaxangle {120}
*createmark elems 1 "all"
*elementtestinterangle elements 1 $triamaxangle 1 2 0 2 0 " 2D Tria Max Angle "
set triamaxe [hm_marklength elems 2]
set quadminangle {45}
*createmark elems 1 "all"
*elementtestinterangle elements 1 $quadminangle 0 2 1 2 0 " 2D Quad Min Angle "
set quadmine [hm_marklength elems 2]
set quadmaxangle {135}
*createmark elems 1 "all"
*elementtestinterangle elements 1 $quadmaxangle 0 2 0 2 0 " 2D Quad Max Angle "
set quadmaxe [hm_marklength elems 2]
puts $filename "Element Quality Checks"
puts $filename "Minimum length - $minfail of $n_elems"
puts $filename "Maximum length - $maxfail of $n_elems"
puts $filename "Skew - $skewe of $n_elems"
puts $filename "Jacobian - $jacobiane of $n_elems"
puts $filename "Min Tria Angle - $triamine of $n_tria"
puts $filename "Max Tria Angle - $triamaxe of $n_tria"
puts $filename "Min Quad Angle - $quadmine of $n_quad"
puts $filename "Max Quad Angle - $quadmaxe of $n_quad"
close $filename
OUTPUT:
Model:
REPORT:
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...
Project - 2 - Generating the report for hypermesh file
AIM: To create a macro for generating the report for hypermesh file. CODE: # getting username, date and time!*clearmarkall 1*clearmarkall 2set filename [open Output.csv w]set systemname "$env(COMPUTERNAME)"puts $filename "USERNAME-$systemname"puts $filename [clock format [clock seconds]] # finding the number of component,…
07 Feb 2022 11:52 AM IST
Project 1- Building a Master TCL/TK Macro
AIM: To create a master macro using previous challenge PROCEDURE: CODE: #setting up the windowset a .master catch {destroy $a}toplevel $a -class TopLevelwm title $a "Master Macro" #size of a window tab is defined:wm geometry $a 660x515+0+0; update wm resizable $a 0 0wm deiconify $a #creating label label $a.001 -text…
02 Feb 2022 04:53 PM IST
Week - 12 - Creating the locator, writing and reading the node data
AIM: To create macro for locator, writing and reading node data. PROCEDURE: CODE: *clearmarkall 1 ; *clearmarkall 2set a .connectors catch [destroy $a]toplevel $awm title $a "CONNECTORS"wm geometry $a 200x210+100+300;wm resizable $a 0 0wm deiconify $a#buttons button $a.01 -text "Collectors" -command collectors…
02 Feb 2022 11:02 AM IST
Week - 11 - Element quality check
AIM: To create a macro for element quality check. PROCEDURE: CODE: #setting up the windowset a .element catch {destroy $a}toplevel $a -class TopLevelwm title $a "Quality Check" #size of a window tab is defined:wm geometry $a 390x500+50+50; update wm resizable $a 0 0wm deiconify $a #creating label label $a.001…
01 Feb 2022 03:22 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.