diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index 7c837e9e65..2eb8f6983b 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -432,7 +432,11 @@ SCH_SHEET* SCH_SEXPR_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema { // Clean up any allocated memory if an exception occurs loading the schematic. std::unique_ptr newSheet = std::make_unique( aSchematic ); - newSheet->SetFileName( aFileName ); + + wxFileName relPath( aFileName ); + relPath.MakeRelativeTo( aSchematic->Prj().GetProjectPath(), wxPATH_UNIX ); + + newSheet->SetFileName( relPath.GetFullPath() ); m_rootSheet = newSheet.get(); loadHierarchy( newSheet.get() );