UL_DEVICE

Data members

   
activetechnology string (see note)
area UL_AREA
description string
headline string
library string
libraryurn string (see note)
libraryversion int (see note)
name string (DEVICE_NAME_LENGTH)
footprint UL_FOOTPRINT (new as of EAGLE 9.1, see note)
prefix string (DEVICE_PREFIX_LENGTH)
technologies string (see note)
value string ("On" or "Off")

Loop members

   
attributes() UL_ATTRIBUTE (see note)
gates() UL_GATE
packages3d() UL_PACKAGE3D

See also UL_DEVICESET, UL_LIBRARY, UL_PART

Constants

   
DEVICE_NAME_LENGTH max. recommended length of a device name (used in formatted output only)
DEVICE_PREFIX_LENGTH max. recommended length of a device prefix (used in formatted output only)

All members of UL_DEVICE, except for name and technologies, return the same values as the respective members of the UL_DEVICESET in which the UL_DEVICE has been defined. The name member returns the name of the package variant this device has been created for using the PACKAGE command. When using the description text keep in mind that it may contain newline characters ('\n').

Notes

The value returned by the activetechnology member depends on the context in which it is called:

The footprint data member returns the footprint that has been assigned to the device through a PACKAGE command. It can be used as a boolean function to check whether a footprint has been assigned to a device (see example below). (Note that the footprint data memmber is new as of EAGLE 9.1. For backwards compatibility with previous EAGLE versions, package is also supported.)

The value returned by the technologies member depends on the context in which it is called:

The attributes() loop member takes an additional parameter that specifies for which technology the attributes shall be delivered (see the second example below).

The libraryurn and libraryversion are only applicable if this UL_DEVICE comes from a managed library. If not, libraryurn will be the empty string and libraryversion will be -1.

Examples

library(L) {
  L.devicesets(S) {
    S.devices(D) {
      if (D.footprint)
         printf("Device: %s, Footprint: %s\n", D.name, D.footprint.name);
      D.gates(G) {
        printf("\t%s\n", G.name);
        }
      }
    }
  }

  
library(L) {
  L.devicesets(DS) {
    DS.devices(D) {
      string t[];
      int n = strsplit(t, D.technologies, ' ');
      for (int i = 0; i < n; i++) {
          D.attributes(A, t[i]) {
            printf("%s = %s\n", A.name, A.value);
            }
          }
      }
    }
  }