Hi,
so I did not really gave up and tried a XML framework for python - as parse whole XML in awk is insane. (It is installed in my OpenSuse as default, hope other distributions have it too).

Usage

python xmlparse.py -i xmltest.qet -o xmltest_renumbered.qet

and result should be renumbered all "ten"s and "hundred"s according to the prefix and position in schematics from top down and left right manner. Items without these tags are ignored.

It actually does only this and nothing else, it does not care at all about any formulas etc.

This is definitely enough for me now - hope somebody find it also useful and perhaps add additional functionality as I really do not have needed skills in Python.

Cheers,
Jan.

OK, your awk is in different location... then you can use it as before, with direct awk call. nomicons/smile

I'm thinking about solving the issue of numbering from left to right + from up to down and it would need me to parse whole xml and do really, really a lot of stuff... I'm afraid this is no way, no quick solution for the moment. Giving up nomicons/sad 

Regards

Jan.

Hi,
yes, it is going to be VERY complicated if you like catch every possible rule. This should be done inside the Qelectrotech and not externally (my opinion).
I did play with the script little more and implemented functionality to renumber items according to the "prefix", so with each prefix it starts a new numbering (new seqt_1 sequence from 1 up to items with the same prefix).

./renumber_v4.awk contacts.qet > contacts_renumbered.qet

The problems:
- it can go wrong if you have different formula than "%id%prefix%seqt_1"
- if you have device without prefix, it will not work (can be easily fixed but anyway, it is not a solution)
- the numbering increases the item value as it flow through the xml file. So it seems to be a little random... and I have no idea how to fix this.

For my needs I can use as it is... but not really helpful in other cases. The script would be really difficult to implement if you like to catch every possibility.

Regards

Jan.

Hi,
ok, seems clear - so I wrote small script in awk which will do this work for me.
Maybe somebody else find it usefull...

Before trying be sure you have proper backup! As I'm not really aware of all xml syntax, it can go very wrong!

Cheers,

Jan.

Hi,
autonumbering seems to work ok, but you need to reopen the project again on order to see it...

Is there a plan to implement renumbering feature?

Cheers,

Jan

Hi all,
we are using autonumbering feature inside the drawings for contactors, terminals, inverters etc. So far so good.
Now I need to change numbering scheme for terminal or filling the gaps thanks to deleting a few of them and the re-adding (and I forgot to manually change sequence number).
Is here any way to automatically renumber whole project or at least one device type?

I'm using v 0.7 lastest dev.
Thanks!
Regards

Jan.