top of page
Admin

Rename all properties with component name

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
	}	
}

2 views0 comments

Recent Posts

See All

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...

Commentaires

Noté 0 étoile sur 5.
Pas encore de note

Ajouter une note
bottom of page