Method to renumber sheets in hierarchical sheets

Hello all,

I’ve recently went through this topic which is now closed because it has been inactive for a while.
I’ve just found a method to do it and I think I would be useful to know for some people. I will surely make a script for that but for now I leave it here.

So basically you should not open every child sheet to modify its content.
These modifications will be overriden as @SembazuruCDE mentioned. Instead open the root sheet file in a text editor. Then you can start searching for $Sheet and you should see code corresponding to the child sheets that are included your root schematic. These appear in the file at random places, the order corresponds to chronological order of creation of these sheets.
These blocks $Sheet ... $EndSheet basically designate what to display on your schematic. And in fact, the order for the sheets in KiCad (and also for page numbering) is just the same order as the order of these blocks in the root schematic file.
So all you have to do is to move the blocks $Sheet ... $EndSheet and place them at the start of your file, just after the $EndDescr, in the right order.

Hope this help,

Feel free to ask if anything is unclear.

Regards,

Loïc

Actually, what I was referring to as getting re-ordered was the order of the sheet definition blocks in the root sheet file.

To resurrect my quote:

The file I was referring to was the root sheet file. Sorry to burst your bubble.

BTW, this only applies to V5.x and earlier. I think I remember hearing that v6 will have a way to define page numbers for hierarchical sheets, but I could be mistaken.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.