From 63f67b7e5b8a1f490b4d89e4fc61b52791cfeb15 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Tue, 7 Dec 2021 18:55:08 -0500 Subject: [PATCH] Fix loading netclasses from legacy boards via Python --- 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 0cfd105820..f18cc58cda 100644 --- a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp @@ -47,6 +47,8 @@ #include #include #include +#include +#include #include #include #include @@ -158,6 +160,9 @@ BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat ) { brd->SetProject( project ); + if( brd->m_LegacyDesignSettingsLoaded ) + project->GetProjectFile().NetSettings().RebuildNetClassAssignments(); + // Move legacy view settings to local project settings if( !brd->m_LegacyVisibleLayers.test( Rescue ) ) project->GetLocalSettings().m_VisibleLayers = brd->m_LegacyVisibleLayers;