function getCircuitPin(work, ref) {
    contact = getCircuitContact(work, ref);
    if (!contact.isPin()) {
        throw "Contact '" + ref + "' is not a component pin";
    }