Cadsoft EAGLE Light - User Language Program question
idbruce
Posts: 6,197
Hello Everyone
I am dabbling with EAGLE ULPs(User Language Program ) for the very first time and I am having a bit of trouble. My goal is to determine the size of any given PCB by running a ULP, so that I may programmatically center an alignment layer around the board. Before I try making the new layer, I want to ensure that I can acquire the dimensions and display them in a dialog box. Here is what I have so far:
I have verified that the code is working up to the third line containing B.dimensions(D). For some odd reason, this is not working. Any suggestions?
Bruce
I am dabbling with EAGLE ULPs(User Language Program ) for the very first time and I am having a bit of trouble. My goal is to determine the size of any given PCB by running a ULP, so that I may programmatically center an alignment layer around the board. Before I try making the new layer, I want to ensure that I can acquire the dimensions and display them in a dialog box. Here is what I have so far:
if (board) { board(B) { B.dimensions(D) { string boardDimensions; sprintf(boardDimensions, "(%d %d), (%d %d), (%d %d)\n", D.x1, D.y1, D.x2, D.y2, D.x3, D.y3); dlgMessageBox(boardDimensions, "OK", "Cancel"); } } }
I have verified that the code is working up to the third line containing B.dimensions(D). For some odd reason, this is not working. Any suggestions?
Bruce
Comments
I keep finding myself wandering down these blind alleys with software. They are annoying and software providers - especially ones that provide free software - tend to start out by offering quite a bit and then realizing that they have to much to do without any revenue.
statistic-brd.ulp provided by Cadsoft with the Eagle download, which can be found in the ULP directory, provides a work around for obtaining board dimensions, but there is a lot more to the code than what I listed above, and of course copyrights must be considered.
Bruce
Is dimensions a new thing? I'm still on eagle 5.10 and there is no board.dimensions - you have to go through the
wires in the dimensions layer to find the outline and thus calculate a bounding box.
http://web.mit.edu/xavid/arch/i386_rhel4/help/164.htm
so something like this: