From b3de5aa08e005801c07495edb2d39e394952ef02 Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Tue, 21 Mar 2023 01:18:33 +0000 Subject: [PATCH] Put the project name back into the step pcb label. Software like Solidworks and other CAD treat STEP labels as unique entries. When you import multi STEP files into the same project, it'll start deduplicating your design by those name. So two completely unrelated PCBs with the same "PCB" name will result in one being replaced by another. --- pcbnew/exporters/step/step_pcb_model.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcbnew/exporters/step/step_pcb_model.cpp b/pcbnew/exporters/step/step_pcb_model.cpp index b6b41b65df..e53e90dfcc 100644 --- a/pcbnew/exporters/step/step_pcb_model.cpp +++ b/pcbnew/exporters/step/step_pcb_model.cpp @@ -557,10 +557,13 @@ bool STEP_PCB_MODEL::CreatePCB( SHAPE_POLY_SET& aOutline, VECTOR2D aOrigin ) { wxString pcbName; + // Note, we include the pcb/project name as a prefix + // because several STEP importing CAD software like SolidWorks + // will deduplicate anything imported by it's STEP name if( m_pcb_labels.size() == 1 ) - pcbName = wxT( "PCB" ); + pcbName = wxString::Format( wxT( "%s PCB" ), m_pcbName ); else - pcbName = wxString::Format( wxT( "PCB%d" ), pcbIdx++ ); + pcbName = wxString::Format( wxT( "%s PCB%d" ), m_pcbName, pcbIdx++ ); std::string pcbNameStdString( pcbName.ToUTF8() ); TCollection_ExtendedString partname( pcbNameStdString.c_str() );