#usage "Data generation for mounting machines

\n" "This ULP generates a file that can be used with mounting machines. " "The x- and y- coordinates (units: mil) are calculated as mean of " "maximum and mimimum value of the pads or smds origin points. " "The calculated value does not necessarily fit with the origin " "point of the part in the layout.

" "The syntax of the output data looks like this:

" "     Value;x-coord;y-coord;Rotation;Name

" "Author: support@cadsoft.de" board(B) { // Get filename string fileName = dlgFileSave("Save File", filesetext(B.name, ".mnt"), "*.mnt"); if (fileName == "") exit(0); output(fileName) { B.elements(E) { int xmax =-2147483648, xmin = 2147483647, ymax = xmax, ymin = xmin; E.package.contacts(C) { if (C.x > xmax) xmax = C.x; if (C.y > ymax) ymax = C.y; if (C.x < xmin) xmin = C.x; if (C.y < ymin) ymin = C.y; } printf("%s;%5.0f;%5.0f;%3.0f;%s \n", E.value, u2mil((xmin + xmax)/2), u2mil((ymin + ymax)/2), E.angle, E.name ); } } }