KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_API_SAVE Namespace Reference

Functions

bool SaveSheetToFile (SCH_SHEET *aSheet, SCHEMATIC &aSchematic, const wxString &aPath)
 Write a single sheet to disk via SCH_IO.
 
void UpdateProjectFile (SCHEMATIC &aSchematic, PROJECT &aProject)
 Sync schematic metadata into the project file (.kicad_pro) and save it.
 
bool SaveSchematic (SCHEMATIC &aSchematic, PROJECT &aProject)
 Save every screen in the hierarchy to its current path, then update the project file.
 
bool SaveSchematicCopy (SCHEMATIC &aSchematic, PROJECT &aProject, const wxString &aFileName, bool aCreateProject)
 Save the root schematic to aFileName without changing the open document.
 

Function Documentation

◆ SaveSchematic()

◆ SaveSchematicCopy()

bool SCH_API_SAVE::SaveSchematicCopy ( SCHEMATIC & aSchematic,
PROJECT & aProject,
const wxString & aFileName,
bool aCreateProject )

Save the root schematic to aFileName without changing the open document.

If aFileName matches the open root schematic, this delegates to SaveSchematic(). Otherwise only the root sheet is written (subsheets are not remapped).

When aCreateProject is true and the destination project file does not exist yet, a copy of the current project is written alongside the new schematic.

Definition at line 197 of file sch_api_save.cpp.

References SCH_SCREEN::GetFileName(), PGM_BASE::GetSettingsManager(), Pgm(), FILEEXT::ProjectFileExtension, SCHEMATIC::Root(), SCHEMATIC::RootScreen(), SETTINGS_MANAGER::SaveProjectCopy(), SaveSchematic(), and SaveSheetToFile().

Referenced by HEADLESS_SCH_CONTEXT::SaveSchematicCopy(), and SCH_EDIT_FRAME_CONTEXT::SaveSchematicCopy().

◆ SaveSheetToFile()

bool SCH_API_SAVE::SaveSheetToFile ( SCH_SHEET * aSheet,
SCHEMATIC & aSchematic,
const wxString & aPath )

Write a single sheet to disk via SCH_IO.

Definition at line 43 of file sch_api_save.cpp.

References SCH_IO_MGR::GuessPluginTypeFromSchPath(), KIPLATFORM::IO::MakeWriteable(), and IO_ERROR::What().

Referenced by SaveSchematic(), and SaveSchematicCopy().

◆ UpdateProjectFile()