EAGLE Help

board()


Function
Opens a board context.

Syntax
board(identifier) statement

Description
The board statement opens a board context if the current editor window contains a board drawing. A variable of type UL_BOARD is created and is given the name indicated by identifier.

Once the board context is successfully opened and a board variable has been created, the statement is executed. Within the scope of the statement the board variable can be accessed to retrieve further data from the board.

If the current editor window does not contain a board drawing, an error message is given and the ULP is terminated.

See also schematic, library

Check if there is a board

By using the board statement without an argument you can check if the current editor window contains a board drawing. In that case, board behaves like an integer constant, returning 1 if there is a board drawing in the current editor window, and 0 otherwise.

Accessing board from a schematic

If the current editor window contains a schematic drawing, you can still access that schematic's board by preceding the board statement with the prefix project, as in

project.board(B) { ... }
This will open a board context regardless whether the current editor window contains a board or a schematic drawing. However, there must be an editor window containing that board somewhere on the desktop!

Example

if (board)
   board(B) {
     B.elements(E)
       printf("Element: %s\n", E.name);
     }

Index Copyright © 2005 CadSoft Computer GmbH