EAGLE Help

library()


Function
Opens a library context.

Syntax
library(identifier) statement

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

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

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

See also board, schematic, deviceset, package, symbol

Check if there is a library

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

Example

if (library)
   library(L) {
     L.devices(D)
       printf("Device: %s\n", D.name);
     }

Index Copyright © 2005 CadSoft Computer GmbH