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