angle | real (0, 90, 180 and 270) |
column | string (see note) |
gate | UL_GATE |
mirror | int |
name | string (INSTANCE_NAME_LENGTH) |
part | UL_PART |
row | string (see note) |
sheet | int (0=unused, >0=sheet number) |
smashed | int (see note) |
value | string (PART_VALUE_LENGTH) |
x, y | int (origin point) |
attributes() | UL_ATTRIBUTE (see note) |
texts() | UL_TEXT (see note) |
xrefs() | UL_GATE (see note) |
See also UL_PINREF
INSTANCE_NAME_LENGTH | max. recommended length of an instance name (used in formatted output only) |
PART_VALUE_LENGTH | max. recommended length of a part value (instances do not have a value of their own!) |
The attributes() member only loops through those attributes that have been explicitly assigned to this instance (including smashed attributes).
The texts() member only loops through those texts of the instance that have been detached using REPOSITION, and through the visible texts of any attributes assigned to this instance. To process all texts of an instance, you have to loop through the instance's own texts() member as well as the texts() member of the instance's gate's symbol. If attributes have been assigned to an instance, texts() delivers their texts in the form as they are currently visible.
The column and row members return the column and row location within the frame on the sheet on which this instance is invoked. If there is no frame on that sheet, or the instance is placed outside the frame, a '?' (question mark) is returned. These members can only be used in a sheet context.
The smashed member tells whether the instance 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", "VALUE", "PART" and "GATE", as well as the names of any user defined attributes. They are treated case insensitive, and they may be preceded by a '>' character.
The xrefs() member loops through the contact cross-reference gates of this instance. These are only of importance if the ULP is going to create a drawing of some sort (for instance a DXF file).
schematic(S) {
S.parts(P) {
printf("Part: %s\n", P.name);
P.instances(I) {
if (I.sheet != 0)
printf("\t%s used on sheet %d\n", I.name, I.sheet);
}
}
}