EAGLE Help

Object Types


The EAGLE data structures are stored in three binary file types: These data files contain a hierarchy of objects. In a User Language Program you can access these hierarchies through their respective builtin access statements:
library(L) { ... }
schematic(S) { ... }
board(B) { ... }
These access statements set up a context within which you can access all of the objects contained in the library, schematic or board.

The properties of these objects can be accessed through members.

There are two kinds of members:

Data members immediately return the requested data from an object. For example, in
board(B) {
  printf("%s\n", B.name);
  }
the data member name of the board object B returns the board's name.
Data members can also return other objects, as in
board(B) {
  printf("%f\n", B.grid.size);
  }
where the board's grid data member returns a grid object, of which the size data member then returns the grid's size.

Loop members are used to access multiple objects of the same kind, which are contained in a higher level object:

board(B) {
  B.elements(E) {
    printf("%-8s %-8s\n", E.name, E.value);
    }
  }
This example uses the board's elements() loop member function to set up a loop through all of the board's elements. The block following the B.elements(E) statement is executed in turn for each element, and the current element can be referenced inside the block through the name E.

Loop members process objects in alpha-numerical order, provided they have a name.

A loop member function creates a variable of the type necessary to hold the requested objects. You are free to use any valid name for such a variable, so the above example might also be written as

board(MyBoard) {
  B.elements(TheCurrentElement) {
    printf("%-8s %-8s\n", TheCurrentElement.name, TheCurrentElement.value);
    }
  }
and would do the exact same thing. The scope of the variable created by a loop member function is limited to the statement (or block) immediately following the loop function call.

Object hierarchy of a Library:

LIBRARY
  GRID
  LAYER
  DEVICESET
    DEVICE
    GATE
  PACKAGE
    PAD
    SMD
    CIRCLE
    HOLE
    RECTANGLE
    TEXT
    WIRE
    POLYGON
      WIRE
  SYMBOL
    PIN
    CIRCLE
    RECTANGLE
    TEXT
    WIRE
    POLYGON
      WIRE
Object hierarchy of a Schematic:
SCHEMATIC
  GRID
  LAYER
  LIBRARY
  SHEET
    CIRCLE
    RECTANGLE
    TEXT
    WIRE
    POLYGON
      WIRE
    PART
      INSTANCE
    BUS
      SEGMENT
        TEXT
        WIRE
    NET
      SEGMENT
        JUNCTION
        PINREF
        TEXT
        WIRE
Object hierarchy of a Board:
BOARD
  GRID
  LAYER
  LIBRARY
  CIRCLE
  HOLE
  RECTANGLE
  TEXT
  WIRE
  POLYGON
    WIRE
  ELEMENT
  SIGNAL
    CONTACTREF
    POLYGON
      WIRE
    VIA
    WIRE

Index Copyright © 2005 CadSoft Computer GmbH