Eagle : Export PCBs quickly with this script

2018 Sep 24
#electronics  #elecFab 

Exporting image files for milling PCBs is a tedious operation. Fortunately, Eagle has a built-in scripting interface. Customized scripts, spanning multitudes of operations, can be launched from the file menu. The following script, based on this one, will output two PNGs, one for traces and the other for the outline and holes. The PNGs can then be coverted to milling tool paths via Fab Modules.

DISPLAY ALL;
RATSNEST;
DISPLAY None;
DISPLAY Top Pads Vias;
SET DISPLAY_MODE NODRILL;
SET PAD_NAMES OFF;
SET PALETTE BLACK;
EXPORT IMAGE  /*/pcb_traces.png MONOCHROME 1500;
DISPLAY None;
SET DISPLAY_MODE REAL;
DISPLAY Pads;
EXPORT IMAGE /*/pcb_outline.png MONOCHROME 1500;
SET PAD_NAMES ON;
DISPLAY MYSET;

In this line set the DPI and image processing options, in addition to the filepath and output name. Each line should end with an ';'.

EXPORT IMAGE  /*/pcb_traces.png MONOCHROME 1500;

The last line refers to a custom layer set. You can make these in the layers options, or set it to 'DISPLAY ALL;'.

DISPLAY MYSET;

Finally, I cannot find a script for turning off the trace labels. Often, this will not impace the output file, but it can. Enter the command 'SET' to launch an option dialogue. Toggle the 'Display signal names on traces' checkbox. The Pad names are toggled within the script.

Save the script locally and launch it via the "Execute Script..." command in the file menu.

Use an image processing application to fill in non-cut portion of the outputed outline file.

Simple as that.
Additional resources...

  • Eagle Commands : within the 'Editor Commands' submenu
  • I sourced the basic script from this post.
  • Sparkfun's Guide to Eagle is fantastic.
  • Share this post...

    « Previous post :: Environmental monitoring with online data logging to Thingsv

    Over the past few months, I have continued to develop the electronics and programming aspects of this project. I now have a system for evualating power potential and environmental sensing, and logging all that data online to Things Speak, an open Internet of Things Platform. Previous to using Things Speak, I was logging data to an SD card. However, with an SD card, I need to periodically pull the data from the card. Extra work. Using Things Speak, the data is available to me and everyone else instantly, everywhere. There have been some issues with wifi stability and internet connectivity...