DXF import: verify the layer used to import the DXF drawings is valid (correctly selected).

This commit is contained in:
jean-pierre charras 2018-07-23 13:56:30 +02:00
parent 82d492a840
commit a27ba65ed2
1 changed files with 7 additions and 0 deletions

View File

@ -293,6 +293,13 @@ bool DIALOG_DXF_IMPORT::TransferDataFromWindow()
// Set coordinates offset for import (offset is given in mm) // Set coordinates offset for import (offset is given in mm)
m_dxfImporter.SetOffset( offsetX, offsetY ); m_dxfImporter.SetOffset( offsetX, offsetY );
m_layer = m_SelLayerBox->GetLayerSelection(); m_layer = m_SelLayerBox->GetLayerSelection();
if( m_layer < 0 )
{
wxMessageBox( _( "Please, select a valid layer " ) );
return false;
}
m_dxfImporter.SetBrdLayer( m_layer ); m_dxfImporter.SetBrdLayer( m_layer );
m_PCBdefaultLineWidth = getPCBdefaultLineWidthMM(); m_PCBdefaultLineWidth = getPCBdefaultLineWidthMM();
m_dxfImporter.SetDefaultLineWidthMM( m_PCBdefaultLineWidth ); m_dxfImporter.SetDefaultLineWidthMM( m_PCBdefaultLineWidth );