/* * 0V_RESTR.ULP * * This EAGLE User Language Program is used, if you put a "0V" polygon * on the TOP-layer of a board.It puts RECTs on the "trestrict" layer * on all the pins those are connect to the net "0V". * You may wish this, if you want to sold your print just on the bottom - * layer. * In a board editor window you can Run this ULP. * Thereafter execute the script text - file "0V_REST.SCR". * * Perhaps you have to change the output - path ! * * Since EAGLE does not allow input - parameters with the "RUN" - command * so far, you would have to change the net - name ("0V"), if you like * to use this ULP with other nets. * * Any questions ? - contact me: * Daemon Reinhard * Tel: ++43-316-873-8645 * FAX: ++43-316-873-8655 * E-Mail: yum@fexphds01.tu-graz.ac.at */ if (board) board(B) { output("C:\\EAGLE\\SCR\\0V_RESTR.SCR") { int cnt2 = 0; int cnt = 0, coordx[], coordy[], ydiameter[]; B.signals(S) { if (S.name == "0V") { numeric string Part[], Pad[]; S.contactrefs(C) { Part[cnt] = C.element.name; Pad[cnt] = C.contact.name; coordx[cnt] = C.contact.x; coordy[cnt] = C.contact.y; B.elements(E) { if (E.name == C.element.name) { E.package.contacts(CC) { if ((CC.name == Pad[cnt])) if ((CC.pad) && !(CC.smd)) { ydiameter[cnt] = CC.pad.diameter; cnt++; } } } } } } } int cnt1 = 0; int x1[]; int y1[]; int x2[]; int y2[]; for(cnt1 = 0; cnt1 < cnt; cnt1++) { x1[cnt1] = u2mil(coordx[cnt1]) - u2mil(ydiameter[cnt1])/2 - 50; y1[cnt1] = u2mil(coordy[cnt1]) - u2mil(ydiameter[cnt1])/2 - 50; x2[cnt1] = u2mil(coordx[cnt1]) + u2mil(ydiameter[cnt1])/2 + 50; y2[cnt1] = u2mil(coordy[cnt1]) + u2mil(ydiameter[cnt1])/2 + 50; } /* SCRIPT - DATEI !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ printf("grid mil;\n"); printf("ch layer 41;\n"); for(cnt1 = 0; cnt1 < cnt; cnt1++) printf("rect (%d %d) (%d %d);\n",x1[cnt1], y1[cnt1], x2[cnt1], y2[cnt1]); printf("grid last;\n"); printf("grid last;\n"); } } else { output("C:\\EAGLE\\SCR\\0V_RESTR.SCR") printf("Actual Window is not a BOARD !"); }