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
List the files in the folder by using TCL

Here is a simple script to list all the files in a folder with or without file extension. set folder [tk_chooseDirectory -title "Select a folder"] if {$folder eq ""} { puts "No folder selected."

 
 
 
Solutions in Nastran

Here's a concise definition table for every solution type (SOL) in NASTRAN, focusing on commonly used ones. Each entry includes the SOL number, solution type, and a brief description. SOL Number Name

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

© 2023

 
bottom of page