/****************************************************************************** * UNROUTED.ULP - please send any comments to hv@itec-audio.com * * This EAGLE User Language Program generates a Script * file that can determine unrouted signals (layer 19). * This may be necessary, whenever the "ratsnest" - command * tells you that still exist signals to route, but you can * not see them, because they are too tiny. * This ULP is also much more faster, if you have polygons on your board. * The ULP returns errorlevel 100 if there are no more airwires. * Optional you can output all wires (AllWires = Yes, Output to WIRES.TXT) * * In a board editor window you can Run this ULP. * Look the text-file "UNROUTED.TXT" in the current directory. * * V1.1 19.01.00 Minor changes * 16.07.99 Helmut Vaupotitsch - hv@itec-audio.com * AllWires = Yes|No * other minor changes, added errorlevel for no airwires * V1.0 ??.??.?? Daemon Reinhard * Tel: ++43-316-873-8645 * FAX: ++43-316-873-8655 * E-Mail: yum@fexphds01.tu-graz.ac.at * * Errorlevel -1: Drawing is not a board * Errorlevel 100: No airwires * *****************************************************************************/ enum {Yes, No}; int AllWires = No; enum { OK=0, NotABoard=-1, NoAirwires=100 }; int ExitCode; void Out(string tab, int grid, int x1, int y1, int x2, int y2) { if (grid == 2) printf("%s(%.0f,%.0f) (%.0f,%.0f)\n", tab, u2mil(x1), u2mil(y1), u2mil(x2), u2mil(y2)); if (grid == 3) printf("%s(%.3f,%.3f) (%.3f,%.3f)\n", tab, u2inch(x1), u2inch(y1), u2inch(x2), u2inch(y2)); if (grid == 1) printf("%s(%.2f,%.2f) (%.2f,%.2f)\n", tab, u2mm(x1), u2mm(y1), u2mm(x2), u2mm(y2)); if (grid == 0) printf("%s(%.0f,%.0f) (%.0f,%.0f)\n", tab, u2mic(x1), u2mic(y1), u2mic(x2), u2mic(y2)); } string name="unrouted.txt"; if (AllWires==Yes) name="wires.txt"; if (board) board(B) { ExitCode = OK; int airw = 0; int sig = 0; int wir = 0; int sigwir = 0; int aw=0; output(name) { if (AllWires==No) printf("Unrouted wires:\n"); B.signals(S) { ++sig; if (AllWires==Yes) { sigwir=0; aw=0; printf("Signal = %s \n", S.name); } S.wires(W) { ++wir; if (AllWires==Yes) { ++sigwir; if (W.layer == 19) { ++aw; ++airw; } Out(" ", B.grid.unit, W.x1,W.y1, W.x2,W.y2); } else if (W.layer == 19) { ++airw; printf("Signal = %-8s", S.name); Out(" ", B.grid.unit, W.x1,W.y1, W.x2,W.y2); } } if (AllWires==Yes) printf(" Signal = %s: %d of %d wires unrouted.\n\n",S.name,aw,sigwir); } printf("\n%d airwires.",airw); printf("\n%d signals, %d wires.\n",sig,wir); if (airw==0) ExitCode = NoAirwires; } } else { output(name) printf("Actual Window is not a BOARD !"); ExitCode = NotABoard; } exit(ExitCode);