From edf6828cf155f9f9d4760bda9c0ada19a59a43a2 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 20 Mar 2023 21:11:28 -0400 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 3c63d1a7f6..291f3aa594 100644 --- a/pcbnew/exporters/step/step_pcb_model.cpp +++ b/pcbnew/exporters/step/step_pcb_model.cpp @@ -646,10 +646,13 @@ bool STEP_PCB_MODEL::CreatePCB( SHAPE_POLY_SET& aOutline, VECTOR2D aOrigin ) } else { + // 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() );