From 419a16ae58c6e6670f9b889080344271a1efbd38 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 28 Feb 2018 11:59:38 +0100 Subject: [PATCH] Eagle import: fix footprint LIB_IDs in the imported board --- pcbnew/files.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 63d81139f5..cd2495bc6d 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -897,6 +897,19 @@ bool PCB_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType ) } + // Update module LIB_IDs to point to the just imported Eagle library + for( MODULE* module : GetBoard()->Modules() ) + { + LIB_ID libId = module->GetFPID(); + + if( libId.GetLibItemName().empty() ) + continue; + + libId.SetLibNickname( newfilename.GetName() ); + module->SetFPID( libId ); + } + + // Store net names for all pads, to create net remap information std::unordered_map netMap;