I think my question is quite similar to this and this, however I didn't manage to modify the provided solutions to fit my problem.
In the following MWE I am trying to define 8 pin anchors in a \foreach loop.
What I am doing is obviously wrong, as I am getting an "Undefined control sequence" error when I try to reference one of this pins.
Can someone provide a minimal example for a defining anchors in a loop?
\documentclass[tikz,border=1cm]{standalone}
\usepackage{circuitikz}
% BEGIN myic definition
\def\w{3cm}
\def\h{4.5cm}
\pgfdeclareshape{myic}{
\anchor{center}{\pgfpointorigin}
\anchor{text}
{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}}
% PIN ANCHORS
% The following code does not work as expected.
% I am looking for a way to define \n anchors in a loop.
\foreach \n in {0,...,7}
{\anchor{in\n}{\pgfpoint{.5*\w}{7*.25cm-\n*.5cm}}}
\foregroundpath{
% RECTANGLE
\pgfsetlinewidth{0.025cm}
\pgfpathrectanglecorners{\pgfpoint{.5*\w}{.5*\h}}{\pgfpoint{-.5*\w}{-.5*\h}}
\pgfusepath{draw}
% PIN NAMES
\foreach \n in {0,...,7}
{\pgftext[right,at={\pgfpoint{.5*\w-.1cm}{7*.25cm-\n*.5cm}}]{\scriptsize IN\n}}
}
}
% END myic definition
\begin{document}
\begin{circuitikz}
\draw (0,0) node[myic] (u0) {U0};
\draw (u0.in0) to[short,-o] ++(1,0); % <- ERROR: Undefined control sequence.
\end{circuitikz}
\end{document}
Here is what I have so far, the red line with a circle is what I am not able to create:
