/* * This EAGLE User Language Program creates the proper format * Centroid file for assembly at Screaming Circuits including * the reference designator, position, layer and orientation * of each part * * www.screamingcircuits.com * */ #usage "Create Centroid file for Screaming Circuits assembly
"
"
Switch to the board layout editor and re-run."); exit(1); } if (board) board(B) { output(filesetext(B.name, "_centroid.csv")) { printf("Screaming Circuits SMD component position file.\n"); printf("Created by Centroid_ScreamingCircuits_smd.ulp %s.\n\n", Version); printf("Centroid Data for pc board: \"%s\" as of: %s\n", filename(B.name), t2string(time())); printf("Measurements are in inches. Comma delimited\n"); printf("Only surface mount components included\n\n"); printf("%s,%s,%s,%s,%s\n", "RefDes", "Layer", "LocationX", "LocationY", "Rotation"); B.elements(E) { int isSmd; isSmd = 0; E.package.contacts(C) { if (C.smd) isSmd = 1; } if (isSmd) printf("%s,%s,%5.3f,%5.3f,%s\n", E.name, side(E.mirror), u2inch(E.x), u2inch(E.y), rotation(E.angle)); } } fileMessage = "
Include this file in the .ZIP file along with your GERBER files and Bill of Materials:
" + filesetext(B.name, "_centroid.csv\n"); dlgMessageBox(fileMessage); }