diff --git a/common/jobs/job_fp_export_svg.h b/common/jobs/job_fp_export_svg.h index f920fb5b21..5224427530 100644 --- a/common/jobs/job_fp_export_svg.h +++ b/common/jobs/job_fp_export_svg.h @@ -44,6 +44,7 @@ public: wxString m_colorTheme; bool m_blackAndWhite; + LSET m_printMaskLayer; }; #endif \ No newline at end of file diff --git a/kicad/cli/command_fp_export_svg.cpp b/kicad/cli/command_fp_export_svg.cpp index f4379049e7..3538cd1ea4 100644 --- a/kicad/cli/command_fp_export_svg.cpp +++ b/kicad/cli/command_fp_export_svg.cpp @@ -33,6 +33,8 @@ CLI::FP_EXPORT_SVG_COMMAND::FP_EXPORT_SVG_COMMAND() : EXPORT_PCB_BASE_COMMAND( "svg" ) { + addLayerArg( false ); + m_argParser.add_argument( "-t", ARG_THEME ) .default_value( std::string() ) .help( UTF8STDSTR( _( "Color theme to use (will default to pcbnew settings)" ) ) ); @@ -50,6 +52,10 @@ CLI::FP_EXPORT_SVG_COMMAND::FP_EXPORT_SVG_COMMAND() : EXPORT_PCB_BASE_COMMAND( " int CLI::FP_EXPORT_SVG_COMMAND::doPerform( KIWAY& aKiway ) { + int baseExit = EXPORT_PCB_BASE_COMMAND::doPerform( aKiway ); + if( baseExit != EXIT_CODES::OK ) + return baseExit; + std::unique_ptr svgJob = std::make_unique( true ); svgJob->m_libraryPath = FROM_UTF8( m_argParser.get( ARG_INPUT ).c_str() ); @@ -65,6 +71,11 @@ int CLI::FP_EXPORT_SVG_COMMAND::doPerform( KIWAY& aKiway ) svgJob->m_colorTheme = FROM_UTF8( m_argParser.get( ARG_THEME ).c_str() ); + if( m_selectedLayers.count() > 0 ) + svgJob->m_printMaskLayer = m_selectedLayers; + else + svgJob->m_printMaskLayer = LSET::AllLayersMask(); + int exitCode = aKiway.ProcessJob( KIWAY::FACE_PCB, svgJob.get() ); return exitCode; diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index 737e0e8742..df1c0ef86a 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -749,7 +749,7 @@ int PCBNEW_JOBS_HANDLER::doFpExportSvg( JOB_FP_EXPORT_SVG* aSvgJob, const FOOTPR svgPlotOptions.m_outputFile = outputFile.GetFullPath(); svgPlotOptions.m_mirror = false; svgPlotOptions.m_pageSizeMode = 2; // board bounding box - svgPlotOptions.m_printMaskLayer = LSET::AllLayersMask(); + svgPlotOptions.m_printMaskLayer = aSvgJob->m_printMaskLayer; svgPlotOptions.m_plotFrame = false; if( !PCB_PLOT_SVG::Plot( brd.get(), svgPlotOptions ) )