RENAMING COMP COLLECTORS IN HYPERMESH using TCL scripts


Hi All,
Anyone can tell me the How to Rename the comp collectors in HyperMesh using TCL scripts.
For suppose Comp name : ABC12345_2.00T and PID : 1 OUTPUT : ABC12345_1
i want to keep that first eight digits, and i want to delete that thickness information and i want to rename with its PID
please tell me If anyone know
Regards,
Sudhakar
Hi
below is a sample of 'make_new_name':
proc make_new_name {name} {
set i 1
set _new_name [string range $name 0 [string last '_' $name]]
set new_name ${_new_name}$i
while {[hm_entityinfo exist comps $new_name]} {set new_name ${_new_name}[incr i]}
set new_name
}


hi Q.NGUYEN-DAI,
Thanks for your support.
but i didn't get exactly '# do some thing over current name to create new one'
what it means.
Regards,
Sudhakar


Hi Tinh,
Thanks for your support,
But Above what you mentioned TCL code not running.
Regards,
Sudhakar


hi Q.NGUYEN-DAI,
Thanks for your support.
but i didn't get exactly '# do some thing over current name to create new one'
what it means.
Regards,
Sudhakar
Do you have some programming skill with TCL ?


Do you have some programming skill with TCL ?
I have very basic Knowledge.


Hi Tinh,
Thanks for your valuable support,
using your TCL code i prepared tcl script to rename all the collectors.
Thanks,
Sudhakar Donepudi


hi Sudhakar,
What changes you made to the script provided by Tinh?
If possible can you paste the complete TCL script you used
hi Sudhakar,
What changes you made to the script provided by Tinh?
If possible can you paste the complete TCL script you used
Hi,
you can use this function
proc make_new_name {name} {set i 0set name_ [string range $name 0 [string last '_' $name]]while {[hm_entityinfo exist comps '${name_}[incr i]' -byname]} {}return ${name_}$i}


Do you have some programming skill with TCL ?
no i need to learn


How to rename the components by thicknesswise by using script? please help me out.
Here is my not-yet-tested code: