/* * THIS VERSION ONLY WORKS WITH EAGLE 4.XX * * This EAGLE User Language Program generates a script * which places a drill legend on the current board. * After executing the ULP update the drill diameter * symbols with Options - Set - Drill - Set * NEW MODIFICATION- PLACES THE SCRIPT IN ANY DIRECTORY * BY ANY NAME YOU WISH. * * * Filename: drillplan2_0.ulp * Edited by: Jeff Moore * Date: February 5th 2001 * Options - Set - Drill - Set * * Edited by: Brad Goodman * Date: January, 30, 2002 * Added separate counts and reporting for plated drills. * Changed order of drawing, to smallest drills are first. * * Origonal Filename: drillplan.ulp * by: Frank Hoffman * * Dieses ULP generiert ein Script, das eine Bohrlegende * im Layout plaziert. * Aktualisieren Sie anschließend die Symbole für die * Bohrdurchmesser mit * * Options - Set - Drill - Set */ int Drilling[]; int Counts[]; int Index[]; int Plating[]; int imax = 0; int totalDrills = 0; int totalPlates = 0; string fileName; void AddDrilling(int Size,int plated) { for ( int i = imax; --i >= 0; ) { if (Drilling[i] == Size) { Counts[i]++; totalDrills++; if (plated == 1) { Plating[i]++; totalPlates++; } return; } } Drilling[imax] = Size; if (plated == 1) { Plating[imax]=1; totalPlates++; } else Plating[imax]=0; Counts[imax++] = 1; totalDrills++; } board(B) { real ylegend; real xlegend = u2mil(B.area.x2) + 40; real drill = 0; B.holes(H) AddDrilling(H.drill,0); B.signals(S) S.vias(V) AddDrilling(V.drill,1); B.elements(E) { E.package.contacts(C) { if (C.pad) AddDrilling(C.pad.drill,1); } E.package.holes(H) AddDrilling(H.drill,0); } sort(imax, Index, Drilling, Counts ); fileName = dlgFileSave("Save Dimensioning Script", filesetext("drillplan",".scr"), "*.scr"); if (fileName == "") exit(0); ylegend = u2mil(B.area.y1) + (imax* 200); output(fileName) { printf("GRID mil 50 ON;\n"); printf("CHANGE SIZE 70;\n"); printf("CHANGE LAYER 45;\n"); printf("WINDOW FIT;\n"); for (int i = 0; i < imax; ++i) { printf("HOLE %f (%f %f);\n", u2mil(Drilling[Index[i]]), xlegend + 200, ylegend - 100); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 40, ylegend, u2mil(B.area.x2) + 3140, ylegend ); printf("TEXT '%5.2f mm' (%f %f);\n", u2mm(Drilling[Index[i]]), xlegend + 440, ylegend - 135 ); printf("TEXT '+/-0.08 mm' (%f %f);\n", xlegend + 1250, ylegend - 135 ); printf("TEXT '%4d' (%f %f);\n",Counts[Index[i]], xlegend + 2200, ylegend - 135 ); if (Counts[Index[i]] == Plating[Index[i]]) printf("TEXT 'Yes' (%f %f);\n", xlegend + 2600, ylegend - 135 ); else printf("TEXT '%4d' (%f %f);\n",Plating[Index[i]], xlegend + 2600, ylegend - 135 ); ylegend -= 200; } ylegend = u2mil(B.area.y1) + (imax* 200); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 40, u2mil(B.area.y1), u2mil(B.area.x2) + 3140, u2mil(B.area.y1)); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 40, ylegend + 400, u2mil(B.area.x2) + 3140, ylegend + 400 ); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 40, u2mil(B.area.y1), u2mil(B.area.x2) + 40, ylegend + 400 ); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 3140, u2mil(B.area.y1), u2mil(B.area.x2) + 3140, ylegend + 400 ); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 40, ylegend + 200, u2mil(B.area.x2) + 3140, ylegend + 200 ); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 40, ylegend, u2mil(B.area.x2) + 3140, ylegend ); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 410, u2mil(B.area.y1), u2mil(B.area.x2) + 410, ylegend + 200 ); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 2140, u2mil(B.area.y1), u2mil(B.area.x2) + 2140, ylegend + 200 ); printf("WIRE 5 (%f %f) (%f %f);\n", u2mil(B.area.x2) + 2540, u2mil(B.area.y1), u2mil(B.area.x2) + 2540, ylegend + 200 ); printf("CHANGE SIZE 150;\n"); printf("TEXT 'DRILL PLAN' (%f %f);\n", xlegend + 800, ylegend + 225); printf("CHANGE SIZE 100;\n"); printf("TEXT 'SYM' (%f %f);\n", xlegend + 50, ylegend + 50); printf("TEXT 'SIZE' (%f %f);\n", xlegend + 460, ylegend + 50); printf("TEXT 'TOL.' (%f %f);\n", xlegend + 1250, ylegend + 50); printf("TEXT 'CNT' (%f %f);\n", xlegend + 2190, ylegend + 50); printf("TEXT 'PLATE' (%f %f);\n", xlegend + 2590, ylegend + 50); printf("CHANGE SIZE 70;\n"); printf("TEXT 'TOTAL' (%f %f);\n", xlegend + 1600, u2mil(B.area.y1) - 150 ); printf("TEXT '%4d' (%f %f);\n",totalDrills, xlegend + 2200, u2mil(B.area.y1) - 150 ); printf("TEXT '%4d' (%f %f);\n",totalPlates, xlegend + 2600, u2mil(B.area.y1) - 150 ); printf("TEXT '(Set the drill symbols with' (%f %f);\n", xlegend + 120, ylegend + 1000 ); printf("TEXT 'Options - Set - Drill - Set)' (%f %f);\n", xlegend + 120, ylegend + 900); printf("TEXT 'Drill file will contain one extra of' (%f %f);\n", xlegend + 120, ylegend + 700 ); printf("TEXT 'each drill, placed in above diagram.' (%f %f);\n", xlegend + 120, ylegend + 600); printf("WINDOW FIT;\n"); } }