Hello,
maybe it would help to clarify the terminology a bit here. If we speak about components, each component is unique meaning it is defined somewhere and when we use it in a model we create new occurrence (instance basically) of this component.
That way we can create multiple occurrences of the same component and in the view tree you can identify these instances and their one mutual component by their names:

You can see each occurrence has a colon with a number appended to it. This number tells you as what instance of the given component the occurrence was added into the model. For example "Connecting Rod:3" was the 3rd occurrence of component "Connecting Rod" added into this model.
Note: if you paste the component into different model the numbering will start again from 1 as it only references the current model.
Now to your question, if I understand it correctly you want to change the name of the component so all the occurrences' names will change as well. In that case you can just call name() on your component and paste a string as argument. That string will become the new name of the component. Just remember that the occurrences will still be numbered in the model even though you have set a new name to the component.
I hope I answered your question and this wasn't a waste of time 🙂