UL_PART

Data members

   
attribute[] string (see note)
device UL_DEVICE
deviceset UL_DEVICESET
module UL_MODULE (see note)
modulepart UL_PART (see note)
modulepath string (see note)
name string (PART_NAME_LENGTH)
package3d UL_PACKAGE3D
populate int (0=do not populate, 1=populate)
value string (PART_VALUE_LENGTH)

Loop members

   
attributes() UL_ATTRIBUTE (see note)
instances() UL_INSTANCE (see note)
variants() UL_VARIANT (see note)

See also UL_SCHEMATIC, UL_SHEET

Constants

   
PART_NAME_LENGTH max. recommended length of a part name (used in formatted output only)
PART_VALUE_LENGTH max. recommended length of a part value (used in formatted output only)

Note

The attribute[] member can be used to query a UL_PART 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.

When looping through the attributes() of a UL_PART, only the name, value, defaultvalue and constant members of the resulting UL_ATTRIBUTE objects are valid.

When looping through the assembly variants() of a UL_PART, only actual variants are available. The default assembly variant is not available here. Therefore this loop is not active on parts without assembly variants.

If the part is in a sheet context, the instances() loop member loops only through those instances that are actually used on that sheet. If the part is in a schematic or module context, all instances are looped through.

If the part is a virtual part (virtual parts can be retrieved with UL_SCHEMATIC.allparts(), see UL_SCHEMATIC) the instances() loop is empty.

If the part is from a module or is a virtual part, module refers to this. If not (part in main schematic), module is null.

If the part is virtual, modulepart is the (real) part from the source module module. If it's a part in main schematic or if it's a module part itself modulepart is null.

If the part is virtual, modulepath is a string with the sequence of names of the module instances that point to the module containing the part being used. These names are separated by ':'. In other cases this string is empty.

For example, a virtual part with name 'MI1:R1' has modulepath 'MI1'. 'R101' coming from a module instance 'MX' with offset notation, delivers modulepath 'MX'. 'MAIN:SUB1:SUBSUB1:C5' has modulepath 'MAIN:SUB1:SUBSUB1'.

Not all UL_PART'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 (P.package3d).

Examples

schematic(S) {
  S.parts(P) printf("Part: %s\n", P.name);
}
schematic(S) {
  S.allparts(P) {
    if (P.attribute["REMARK"])
       printf("%s: %s\n", P.name, P.attribute["REMARK"]);
    if (P.modulepart) {
       P.modulepart.instances(I)
         printf("%s is a virtual part from %s in module %s with part instance on sheet %d\n",
                P.name, P.modulepart.name, P.module.name, I.sheet);
    }
    else {
       P.instances(I)
         printf("%s is a part on main schematic with instance on sheet %d\n",
                P.name, I.sheet);
    }
  }
}
schematic(S) {
  S.allparts(P) {
    if (P.modulepart) {
       string miNames[];
       int nr = strsplit(miNames, P.modulepath, ':');
       if (nr == 1)
          printf("%s is a virtual part created by module instance %s in main schematic.\n",
                 P.name, miNames[0]);
       else {
          printf("%s is a virtual part in a multiple hierarchy created by this path of module instances:\n", P.name);
          for (int i = 0; i < nr; ++i)
              printf("%s\n", miNames[i]);
       }
    }
  }
}