(I didn't find a better title for the question. Suggestions are welcomed.)
I have created some new shapes in TikZ and I would like to put one of them below another one when a certain key is passed to this last node. I'll show better what I mean with an example using two rectangles:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns,calc}
\tikzstyle{ground}=[append after command={;\node[draw=red,rectangle,anchor=north] (B) at (\tikzlastnode.south){a}}]
\begin{document}
\begin{tikzpicture}
\node[draw,rectangle,ground,rotate=10] (A) at (0,0){a};% not good
\begin{scope}[shift={(1,0)}]
\node[draw,rectangle,rotate=10] (B) at (0,0){a};
\node[draw=red,rectangle,anchor=north,rotate=10] (C) at (B.south){a};% OK
\end{scope}
\end{tikzpicture}
\end{document}

As you can see, I've created a style that appends to the first node the creation of the second one referred to it correctly. Everything works fine, but, if I need to, for example, rotate both shapes together, I can't find a solution because only the first rectangle is rotated (left). The only way I achieved the desired result has been the one shown in the code, where I had to manually draw the second node and pass to it the rotate option.
So, there is a way to achieve the desired result (on the right) but using the syntax of the first example (on the left)? Notice that both the real shapes involved has been drawn by me so if they need to be customized it is ok.
