Hi Paulius,
From what I saw your old elements don´t have the same prefix as the new elements (KM1, KM2, KM3). The script posted previously won't renumber those old elements as they do not have the same prefix. I have been working on the script, adding some functionalities, I will post about this later, but for the time this might help you.
I made an example emulating what you posted. I relabeled the elements (OLD, VERYOLD). The element's name is:embed://import/10_electric/fabricantes/controladores_visualizadores/pixsys/atr142-abc.elmt and the prefix I want to use is KM.
Usage:
python xmlrenumber.py -i TEST.qet -o TEST_vr.qet -s8 -e atr142-abc.elmt -p KM
This will number the elements with the name 'atr142-abc.elmt' with a prefix different to KM. This only works with the formaula text+number.
Notice they won´t be numbered with the elements in the order of position x,y. If you want to organize them, then use: python xmlrenumber.py -i TEST_vr.qet -o TEST_vr.qet -s4
You might need to install lxml to run the script https://lxml.de/installation.html
Hope this helps.
Post's attachments RenumberQET.zip 148.4 kb, 397 downloads since 2021-04-19