Shop OBEX P1 Docs P2 Docs Learn Events
Cadsoft EAGLE Light - User Language Program question — Parallax Forums

Cadsoft EAGLE Light - User Language Program question

idbruceidbruce Posts: 6,197
edited 2013-04-09 17:21 in General Discussion
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:
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

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-04-01 11:19
    You might verify a couple of particulars. Is that an abandoned, no longer supported feature in Eagle? Is this feature supported in the free version, or do you have to buy a copy that supports it?

    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.
  • idbruceidbruce Posts: 6,197
    edited 2012-04-01 12:16
    Loopy Byteloose

    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
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-04-02 08:44
    It is a bit too much for me. I use Eagle, but I have not looked into this aspect. The place to get good support is from an Eagle user's forum. People with problems and experience are more likely to get together in such.
  • Mark_TMark_T Posts: 1,981
    edited 2013-04-09 17:21
    [ yes I know I'm ressurecting an old thread, but I've been dabbling in Eagle ULPs recently ]

    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:
    board (B)
        {
          B.wires (W)
          {
            if (W.layer == 20) // DIMENSION LAYER
            {
              ....
    
    
Sign In or Register to comment.