以下是一个简单的Tcl程序段,可以在Hypermesh中根据已有的组件创建对应的材料,材料名称与组件名称相同,材料统一为Q235,弹性模量为210GPa,泊松比为0.3:
*createmark components 1 "all"
set components [hm_getmark components 1]
foreach component $components {
set material_name $component
*createmark materials 1 "$material_name"
*deletemark materials 1
*createstringarray 1 "material_name" "$material_name"
*createstringarray 1 "material_type" "isotropic"
*createstringarray 1 "youngs_modulus" "210e9"
*createstringarray 1 "poissons_ratio" "0.3"
*creatematerial 1
}