UL_SMD

Data members

   
angle real (0.0...359.9)
dx[layer], dy[layer] int (size)
flags int (SMD_FLAG_...)
layer int (see note)
name string (SMD_NAME_LENGTH)
roundness int (see note)
signal string
x, y int (center point, see note)

See also UL_FOOTPRINT, UL_CONTACT, UL_PAD

Constants

   
SMD_FLAG_STOP generate stop mask
SMD_FLAG_THERMALS generate thermals
SMD_FLAG_CREAM generate cream mask
SMD_NAME_LENGTH max. recommended length of an smd name (same as CONTACT_NAME_LENGTH)

Note

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

If the dx and dy data members are called with an optional layer index, the data for that layer is returned according to the Design Rules. Valid layers are LAYER_TOP, LAYER_TSTOP and LAYER_TCREAM for an smd in the Top layer, and LAYER_BOTTOM, LAYER_BSTOP and LAYER_BCREAM for an smd in the Bottom layer, respectively.

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

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

if (smd.flags & SMD_FLAG_STOP) {
   ...
   }

Note that if your ULP just wants to draw the objects, you don't need to check these flags explicitly. The dx[] and dy[] members will return the proper data; for instance, if SMD_FLAG_STOP is set, dx[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.footprints(FPT) {
    FPT.contacts(C) {
      if (C.smd)
         printf("Smd: '%s', (%f %f), dx=%f, dy=%f\n",
                 C.name, u2mm(C.smd.x), u2mm(C.smd.y), u2mm(C.smd.dx), u2mm(C.smd.dy));
      }
    }
  }