From daac95400f4c8f46ff953a549d5c6e164a909bd3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 1 Oct 2020 23:43:34 +0100 Subject: [PATCH] Make sure new DRC_ENGINE is initialized. Fixes https://gitlab.com/kicad/code/kicad/issues/5824 --- pcbnew/swig/pcbnew_scripting_helpers.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/swig/pcbnew_scripting_helpers.cpp index c64ccef1b4..4aba510723 100644 --- a/pcbnew/swig/pcbnew_scripting_helpers.cpp +++ b/pcbnew/swig/pcbnew_scripting_helpers.cpp @@ -152,6 +152,17 @@ BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat ) BOARD_DESIGN_SETTINGS& bds = brd->GetDesignSettings(); bds.m_DRCEngine = std::make_shared( brd, &bds ); + try + { + wxFileName rules = pro; + rules.SetExt( DesignRulesFileExtension ); + bds.m_DRCEngine->InitEngine( rules ); + } + catch( ... ) + { + // Best efforts... + } + for( MARKER_PCB* marker : brd->ResolveDRCExclusions() ) brd->Add( marker );