diff --git a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp index e7f315c174..b2cb11e291 100644 --- a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp @@ -179,6 +179,21 @@ BOARD* LoadBoard( wxString& aFileName, PCB_IO_MGR::PCB_FILE_T aFormat ) if( brd ) { + // JEY TODO: move this global to the board + ENUM_MAP& layerEnum = ENUM_MAP::Instance(); + + layerEnum.Choices().Clear(); + layerEnum.Undefined( UNDEFINED_LAYER ); + + for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq ) + { + // Canonical name + layerEnum.Map( *seq, LSET::Name( *seq ) ); + + // User name + layerEnum.Map( *seq, brd->GetLayerName( *seq ) ); + } + brd->SetProject( project ); // Move legacy view settings to local project settings