diff --git a/gerbview/class_gerber_draw_item.cpp b/gerbview/class_gerber_draw_item.cpp index 26f51b1a81..4ddb771135 100644 --- a/gerbview/class_gerber_draw_item.cpp +++ b/gerbview/class_gerber_draw_item.cpp @@ -551,7 +551,11 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) if( ( m_netAttributes.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_NET ) ) { net_msg = _( "Net:" ); - net_msg << " " << m_netAttributes.m_Netname; + net_msg << " "; + if( m_netAttributes.m_Netname.IsEmpty() ) + net_msg << ""; + else + net_msg << m_netAttributes.m_Netname; } if( ( m_netAttributes.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_PAD ) ) diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 0b72a705fa..0e518670a7 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -41,7 +41,7 @@ #include // Uncomment this line to allow experimetal net attributes in Gerber files: -//#define KICAD_USE_GBR_NETATTRIBUTES +#define KICAD_USE_GBR_NETATTRIBUTES DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) : DIALOG_PLOT_BASE( aParent ), m_parent( aParent ), diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 8cfd691c4a..73d8aac2a5 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -459,6 +459,10 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, if( diameter <= 0 ) continue; + // Some vias can be not connected (no net). + // Set the m_NotInNet for these vias to force a empty net name in gerber file + gbr_metadata.m_NetlistMetadata.m_NotInNet = Via->GetNetname().IsEmpty(); + gbr_metadata.SetNetName( Via->GetNetname() ); EDA_COLOR_T color = aBoard->GetVisibleElementColor(VIAS_VISIBLE + Via->GetViaType()); @@ -481,6 +485,10 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, if( !aLayerMask[track->GetLayer()] ) continue; + // Some track segments can be not connected (no net). + // Set the m_NotInNet for these segments to force a empty net name in gerber file + gbr_metadata.m_NetlistMetadata.m_NotInNet = track->GetNetname().IsEmpty(); + gbr_metadata.SetNetName( track->GetNetname() ); int width = track->GetWidth() + itemplotter.getFineWidthAdj(); aPlotter->SetColor( itemplotter.getColor( track->GetLayer() ) );