EAGLE Help

UL_PAD


Data members

angle real (0.0...359.9)
diameter[layer] int
drill int
drillsymbol int
elongation int
flags int (PAD_FLAG_...)
name string (PAD_NAME_LENGTH)
shape[layer] int (PAD_SHAPE_...)
signal string
x, y int (center point, see note)

Constants

PAD_FLAG_STOP generate stop mask
PAD_FLAG_THERMALS generate thermals
PAD_FLAG_FIRST use special "first pad" shape

PAD_SHAPE_SQUARE square
PAD_SHAPE_ROUND round
PAD_SHAPE_OCTAGON octagon
PAD_SHAPE_LONG long
PAD_SHAPE_OFFSET offset
PAD_SHAPE_ANNULUS annulus (only if supply layers are used)
PAD_SHAPE_THERMAL thermal (only if supply layers are used)

PAD_NAME_LENGTH max. recommended length of a pad name (same as CONTACT_NAME_LENGTH)

See also UL_PACKAGE, UL_CONTACT, UL_SMD

Note

The parameters of the pad depend on the context in which it is accessed:

The diameter and shape of the pad depend on the layer for which they shall be retrieved, because they may be different in each layer depending on the Design Rules. If one of the layers LAYER_TOP...LAYER_BOTTOM, LAYER_TSTOP or LAYER_BSTOP is given as the index to the diameter or shape data member, the resulting value will be calculated according to the Design Rules. If LAYER_PADS is given, the raw value as defined in the library will be returned.

drillsymbol returns the number of the drill symbol that has been assigned to this drill diameter (see the manual for a list of defined drill symbols). A value of 0 means that no symbol has been assigned to this drill diameter.

angle defines how many degrees the pad is rotated counterclockwise around its center.

elongation is only valid for shapes PAD_SHAPE_LONG and PAD_SHAPE_OFFSET and defines how many percent the long side of such a pad is longer than its small side. This member returns 0 for any other pad shapes.

The value returned by flags must be masked with the PAD_FLAG_... constants to determine the individual flag settings, as in

if (pad.flags & PAD_FLAG_STOP) {
   ...
   }
Note that if your ULP just wants to draw the objects, you don't need to check these flags explicitly. The diameter[] and shape[] members will return the proper data; for instance, if PAD_FLAG_STOP is set, diameter[LAYER_TSTOP] will return 0, which should result in nothing being drawn in that layer. The flags member is mainly for ULPs that want to create script files that create library objects.

Example

library(L) {
  L.packages(PAC) {
    PAC.contacts(C) {
      if (C.pad)
         printf("Pad: '%s', (%d %d), d=%d\n",
                 C.name, C.pad.x, C.pad.y, C.pad.diameter[LAYER_BOTTOM]);
      }
    }
  }

Index Copyright © 2005 CadSoft Computer GmbH