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.
This commit is contained in:
Mark Roszko 2023-03-21 01:18:33 +00:00
parent ba4773e448
commit b3de5aa08e
1 changed files with 5 additions and 2 deletions

View File

@ -557,10 +557,13 @@ bool STEP_PCB_MODEL::CreatePCB( SHAPE_POLY_SET& aOutline, VECTOR2D aOrigin )
{ {
wxString pcbName; 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 ) if( m_pcb_labels.size() == 1 )
pcbName = wxT( "PCB" ); pcbName = wxString::Format( wxT( "%s PCB" ), m_pcbName );
else else
pcbName = wxString::Format( wxT( "PCB%d" ), pcbIdx++ ); pcbName = wxString::Format( wxT( "%s PCB%d" ), m_pcbName, pcbIdx++ );
std::string pcbNameStdString( pcbName.ToUTF8() ); std::string pcbNameStdString( pcbName.ToUTF8() );
TCollection_ExtendedString partname( pcbNameStdString.c_str() ); TCollection_ExtendedString partname( pcbNameStdString.c_str() );