top of page

Rename all properties with component name

Admin

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

Comparison CROD, CBAR and CBEAM

CROD, CBAR and CBEAM are one of the most popular 1d elements in Nastran. Reflecting real behaviour of structural is crucial for FEM. So,...

Reading a csv file by using tcl

Reading a csv file procedure is similar to the other programming languages. # Open the CSV file in read mode set filePath...

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

© 2023

 
bottom of page