From 73b4196e4645169592f63357f3b59d9d2ec72e57 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 7 Apr 2022 13:23:25 -0300 Subject: [PATCH] Fixed problems with imported sub-sheets - We must avoid processing the sheet and symbol instances of them Fixes #178 --- kibot/kicad/v6_sch.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/kibot/kicad/v6_sch.py b/kibot/kicad/v6_sch.py index 040f57f1..d98f64d6 100644 --- a/kibot/kicad/v6_sch.py +++ b/kibot/kicad/v6_sch.py @@ -1819,13 +1819,16 @@ class SchematicV6(Schematic): for sch in self.sheets: sch.sch = sch.load_sheet(project, fname, self) # Assign the page numbers - if parent is None: - self.all_sheets = [] - for i in self.sheet_instances: - sheet = self.sheet_paths.get(i.path) - if sheet: - sheet.sheet = i.page - self.all_sheets.append(sheet) + if parent is not None: + # Here we finished for sub-sheets + return + # On the main sheet analyze the sheet and symbol instances + self.all_sheets = [] + for i in self.sheet_instances: + sheet = self.sheet_paths.get(i.path) + if sheet: + sheet.sheet = i.page + self.all_sheets.append(sheet) # Create the components list for s in self.symbol_instances: # Get a copy of the original symbol