top of page

Rename all properties with component name

  • Admin
  • Feb 20, 2024
  • 1 min read

This codes gets the names of selected components and assign these names to their properties.



*createmarkpanel comps 1 "Select the components of interest"
set compList [hm_getmark comps 1]
foreach i $compList {
	set compname [hm_getvalue comps id=$i dataname=name]
	set propid [hm_getvalue comp id=$i dataname=property]
	if { $propid == 0 } {
		*createmark elems 1 "by comp" $i
		set propid [lsort -unique [hm_getvalue elems mark=1 dataname=property.id]]
	}
	if { $propid != 0 && [hm_getvalue prop id=$propid dataname=name] != $compname } {	
		*setvalue property id=$propid name=$compname
	}	
}

Recent Posts

See All
Spring elements in NASTRAN

In structural analysis, spring elements play a key role in simulating flexible connections, supports, joints, and contact interactions....

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

© 2023

 
bottom of page