-
Notifications
You must be signed in to change notification settings - Fork 9
Description
I was having trouble getting the plugin to work and one of the problems is the sheet file name needs to be the same when referencing.
The problem is that when you make a new sheet in the schematic editor it automatically references it to relative path name. So a file called Test.kicad_sch will have sheet file designator "Test.kicad_sch" because it is in the same folder.
When I now want to use the sheet and layout in another project (Which for KiCad is always in another folder) the file designator will change to absolute path "C:/folder/folder/folder/Test.kicad_sch".
If you now try to apply the layout in PCB editor you get the error:
LookupError: Destination hierarchy: ['Test.kicad_sch'] does not match source level: 'C:/folder/folder/folder/Test.kicad_sch'
The only way to resolve this is to copy and paste the Test.kicad_sch to the other project and also force it to reference it with relative path. Which defeats the purpose of checking if the destination hierarchy and stuff is the same.. Why is the name of the schematic even checked? If I want to change the name of Test.kicad_sch to Test2.kicad_sch it also doesn't work even though the schematic is the same.
Maybe an idea to not have to check if the Hierarchical sheet schematic and layout file are the same maybe make the layout file part of the Hierarchical sheet schematic file and not check the location etc.
Besides this it might be more user friendly to force users to make a group of the layout they made of a Hierarchical sheet and copy everything in the group over when the layout is restored. This way it is possible to copy over graphical designators etc which can be very useful.
Also once these changes are implemented it is not necessary to have a separate replicate and save and restore layout addon. The layout is part of the sub sheet and can hopefully work multiple times on the same PCB design file.
Workflow would be to link the layout made for a hierarchical sheet to the hierarchical sheet in grouped form. Then in schematic editor copy and paste the hierarchical sheet. And in PCB editor the layout can be copied and will also be in grouped form.