From d5c0bf3d0eb6bfcfc8d041ba02d1abd365bd0747 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 24 Feb 2023 10:43:48 -0300 Subject: [PATCH] Load the global fp-lib-table before running the Python DRC Without this we get parity errors for all the KiCad footprints (cherry picked from commit e5087ca3dba42a90108165cb95628e6cd38b79b1) --- pcbnew/python/scripting/pcbnew_scripting_helpers.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp index 30cba65960..8ea55b6d01 100644 --- a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp @@ -472,6 +472,11 @@ bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits, wxCHECK( prj, false ); + // Load the global fp-lib-table otherwise we can't check the libs parity + wxFileName fn_flp = FP_LIB_TABLE::GetGlobalTableFileName(); + if( fn_flp.FileExists() ) + GFootprintTable.Load( fn_flp.GetFullPath() ); + wxString drcRulesPath = prj->AbsolutePath( fn.GetFullName() ); // Rebuild The Instance of ENUM_MAP (layer names list), because the DRC