angle | real (0.0...359.9) |
attribute[] | string (see note) |
column | string (see note) |
locked | int |
mirror | int |
name | string (ELEMENT_NAME_LENGTH) |
footprint | UL_FOOTPRINT (new as of EAGLE 9.1, see note) |
package3d | UL_PACKAGE3D (see note) |
populate | int (0=do not populate, 1=populate) |
row | string (see note) |
smashed | int (see note) |
spin | int |
value | string (ELEMENT_VALUE_LENGTH) |
x, y | int (origin point) |
attributes() | UL_ATTRIBUTE |
texts() | UL_TEXT (see note) |
See also UL_BOARD, UL_CONTACTREF
ELEMENT_NAME_LENGTH | max. recommended length of an element name (used in formatted output only) |
ELEMENT_VALUE_LENGTH | max. recommended length of an element value (used in formatted output only |
The attribute[] member can be used to query a UL_ELEMENT for the value of a given attribute (see the second example below). The returned string is empty if there is no attribute by the given name, or if this attribute is explicitly empty.
The texts() member only loops through those texts of the element that have been detached using REPOSITION, and through the visible texts of any attributes assigned to this element. To process all texts of an element (e.g. when drawing it), you have to loop through the element's own texts() member as well as the texts() member of the element's footprint.
Note that the footprint member is new as of EAGLE 9.1. For backwards compatibility with older versions, package is available as an alias.
Not all UL_ELEMENT's have 3D packages. The package3d member can be used as a boolean to test whether or not a 3D package is present, e.g. if (E.package3d)
.
angle defines how many degrees the element is rotated counterclockwise around its origin.
The column and row members return the column and row location within the frame in the board drawing. If there is no frame in the drawing, or the element is placed outside the frame, a '?' (question mark) is returned.
The smashed member tells whether the element is smashed. This function can also be used to find out whether there is a detached text parameter by giving the name of that parameter in square brackets, as in smashed["VALUE"]
. This is useful in case you want to select such a text with the MOVE command by doing MOVE R5>VALUE
. Valid parameter names are "NAME" and "VALUE", as well as the names of any user defined attributes. They are treated case insensitive, and they may be preceded by a '>' character.
board(B) {
B.elements(E) {
printf("Element: %s, (%f %f), Footprint=%s\n",
E.name, u2mm(E.x), u2mm(E.y), E.footprint.name);
}
}
board(B) {
B.elements(E) {
if (E.attribute["REMARK"])
printf("%s: %s\n", E.name, E.attribute["REMARK"]);
}
}