diff --git a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp index 620d9db639..bfb743c5fc 100644 --- a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp @@ -241,7 +241,7 @@ BOARD* CreateEmptyBoard() } -bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat ) +bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat, bool aSkipSettings ) { aBoard->BuildConnectivity(); aBoard->SynchronizeNetsAndNetClasses(); @@ -255,20 +255,23 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat ) return false; } - wxFileName pro = aFileName; - pro.SetExt( ProjectFileExtension ); - pro.MakeAbsolute(); - wxString projectPath = pro.GetFullPath(); + if( !aSkipSettings ) + { + wxFileName pro = aFileName; + pro.SetExt( ProjectFileExtension ); + pro.MakeAbsolute(); + wxString projectPath = pro.GetFullPath(); - GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() ); + GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() ); + } return true; } -bool SaveBoard( wxString& aFileName, BOARD* aBoard ) +bool SaveBoard( wxString& aFileName, BOARD* aBoard, bool aSkipSettings ) { - return SaveBoard( aFileName, aBoard, IO_MGR::KICAD_SEXP ); + return SaveBoard( aFileName, aBoard, IO_MGR::KICAD_SEXP, aSkipSettings ); } diff --git a/pcbnew/python/scripting/pcbnew_scripting_helpers.h b/pcbnew/python/scripting/pcbnew_scripting_helpers.h index 772a86c60f..3341667744 100644 --- a/pcbnew/python/scripting/pcbnew_scripting_helpers.h +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.h @@ -67,9 +67,11 @@ BOARD* CreateEmptyBoard(); * Boards can only be saved in KiCad native format. * @param aFileName is the full path to save a copy to. * @param aBoard is a pointer to a loaded BOARD to save. + * @param aSkipSettings if true, only save the board file. This will lose settings changes + * that are saved in the project file * @return true if the save was completed. */ -bool SaveBoard( wxString& aFileName, BOARD* aBoard ); +bool SaveBoard( wxString& aFileName, BOARD* aBoard, bool aSkipSettings = false ); /** * Get the nicknames of all of the footprint libraries configured in