You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

  1. /**
  2. * @file plotdxf.cpp
  3. * @brief Plot DXF.
  4. */
  5. #include <fctsys.h>
  6. #include <common.h>
  7. #include <plot_common.h>
  8. #include <confirm.h>
  9. #include <trigo.h>
  10. #include <wxBasePcbFrame.h>
  11. #include <pcbnew.h>
  12. #include <protos.h>
  13. #include <pcbplot.h>
  14. bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer,
  15. EDA_DRAW_MODE_T aTraceMode )
  16. {
  17. LOCALE_IO toggle;
  18. const PCB_PLOT_PARAMS& plot_opts = GetPlotSettings();
  19. FILE* output_file = wxFopen( aFullFileName, wxT( "wt" ) );
  20. if( output_file == NULL )
  21. {
  22. return false;
  23. }
  24. DXF_PLOTTER* plotter = new DXF_PLOTTER();
  25. plotter->SetPageSettings( GetPageSettings() );
  26. plotter->set_viewport( wxPoint( 0, 0 ), 1, 0 );
  27. plotter->set_creator( wxT( "PCBNEW-DXF" ) );
  28. plotter->set_filename( aFullFileName );
  29. plotter->start_plot( output_file );
  30. if( plot_opts.m_PlotFrameRef )
  31. PlotWorkSheet( plotter, GetScreen() );
  32. Plot_Layer( plotter, aLayer, aTraceMode );
  33. plotter->end_plot();
  34. delete plotter;
  35. return true;
  36. }