Home Forums Nazca Questions and Answers Pin attributes Reply To: Pin attributes

#4191
Ronald
Keymaster

Hi Kristif,

The pins in a cell (“component”) reside in a Python dictionary attribute named ‘pin’.
Hence, if you have cell named C then you can print all pins with
print(C.pin)

The method xya() of a pin gives you the coordinates (x, y, a), but the pin also stores attributes like the xsection (xs) and width. To print specific info on all pins in a cell you can use the following loop over the pin dict:

for name, pin in C.pin.items():
    print("pin '{}'\n  position: {}\n  xs: {}\n  width: {}".\
        format(name, pin.xya(), pin.xs, pin.width))

Similarly, if cell C has a pin named ‘a0’, you can get the coordinates as
x, y, a = C.pin['a0'].xya()

Ronald