constant | int (0=variable, i.e. allows overwriting, 1=constant - see note) |
defaultvalue | string (see note) |
display | int (ATTRIBUTE_DISPLAY_FLAG_...) |
name | string |
text | UL_TEXT (see note) |
value | string |
See also UL_DEVICE, UL_PART, UL_INSTANCE, UL_ELEMENT.
ATTRIBUTE_DISPLAY_FLAG_OFF | nothing is displayed |
ATTRIBUTE_DISPLAY_FLAG_VALUE | value is displayed |
ATTRIBUTE_DISPLAY_FLAG_NAME | name is displayed |
A UL_ATTRIBUTE can be used to access the attributes that have been defined in the library for a device, or assigned to a part in the schematic or board.
display
contains a bitwise or'ed value consisting of ATTRIBUTE_DISPLAY_FLAG_...
and defines which parts of the attribute are actually drawn. This value is only valid if display is used in a UL_INSTANCE or UL_ELEMENT context.
In a UL_ELEMENT context constant only returns an actual value if f/b annotation is active, otherwise it returns 0.
The defaultvalue member returns the value as defined in the library (if different from the actual value, otherwise the same as value). In a UL_ELEMENT context defaultvalue
only returns an actual value if f/b annotation is active, otherwise an empty string is returned.
The text member is only available in a UL_INSTANCE or UL_ELEMENT context and returns a UL_TEXT object that contains all the text parameters. The value of this text object is the string as it will be displayed according to the UL_ATTRIBUTE's 'display' parameter. If called from a different context, the data of the returned UL_TEXT object is undefined.
For global attributes only name and value are defined.
schematic(SCH) {
SCH.parts(P) {
P.attributes(A) {
printf("%s = %s\n", A.name, A.value);
}
}
}
schematic(SCH) {
SCH.attributes(A) { // global attributes
printf("%s = %s\n", A.name, A.value);
}
}