Get Name of component

What is Tcl command to get component name and split it?
Thanks.


if component name is '3532923_M-CROSSMEMBER_ENGINE MTG_BDY_SOLIDS', I only want number '3532923'. how to split it?
Thanks!

hi, i guess you can try to rename rather than splitting

Hello,
Actually i want to get that number from name and set it as that component's id. so renaming is not good option.
Thanks.

First get the component name.
If your compname is 123_comp_comp1.
use split command and get the number.
after that use *<span style='background-color:transparent;color:#000000;'>rename</span>collector
to change the name.
Hope this helps.

@sandeepballiwar Thanks for help. I will try this option.

Is there any option to rename all displayed components at a time?

i don't think there is any api to rename all components at the same time. You need to write a program in in for loop or foreach loop.

Ok.
Thanks for the help /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />

i agree with you!
i think applying a loop is a better solution

@Yu-Ju Chen @sandeepballiwar I have used for loop and it is working good.