diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py index b452dafe3..6814fd2bc 100644 --- a/src/subcircuit/newSub.py +++ b/src/subcircuit/newSub.py @@ -54,7 +54,8 @@ def createSubcircuit(self, subName): os.mkdir(self.schematic_path) self.schematic = os.path.join( self.schematic_path, self.create_schematic) - self.cmd = "eeschema " + self.schematic + ".sch" + # New KiCad v6 file extension + self.cmd = "eeschema " + self.schematic + ".kicad_sch" self.obj_workThread = Worker.WorkerThread(self.cmd) self.obj_workThread.start() self.close() diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py index 53c3cbf1f..03e0175d1 100644 --- a/src/subcircuit/openSub.py +++ b/src/subcircuit/openSub.py @@ -34,6 +34,12 @@ def body(self): self.schname = os.path.basename(self.editfile) self.editfile = os.path.join(self.editfile, self.schname) - self.cmd = "eeschema " + self.editfile + ".sch " + + schematic_file = self.editfile + ".kicad_sch" # kicad6 file + if not os.path.exists(schematic_file) and os.path.exists( + self.editfile + ".sch"): + schematic_file = self.editfile + ".sch" # kicad4 file + + self.cmd = "eeschema " + schematic_file self.obj_workThread = WorkerThread(self.cmd) self.obj_workThread.start()