I am trying to span braces over two rows while keeping the aligment in the following example
in this case the alignment is correct. I think I am nearly there, any help would be greatly appreciated.
The above image is generated by
\begin{equation}
\begin{array}[t]{ccccccccccl}
& & & & & a & a & a &a & \} & d \vspace{0.1cm} \\
\hline \vspace{-0.4cm}\\
& & & & &a & a & a &a\\
& & & & & & b & b & b& \Big\} &d\\
& & & c & c & c & c &c& c \\
\hline \vspace{-0.4cm}\\
& & & a &a & a & a & a &a\\
& & & & b &b &b & b & b & \Big\} & d\\
& c &c & c & c&c& &c& c\vspace{0.1cm} \\
\end{array}\label{eq:diagramm}
\end{equation}.
The braces should look like
but this destroys the alignment. This try is based on this question
\documentclass{article}
\usepackage{amsmath,amsthm,array}% http://ctan.org/pkg/{amsmath,amsthm,array}
\newcommand{\twolinebrace}{\left.\kern-\nulldelimiterspace\begin{array}{@{}c@{}} \\\\\end{array}\right\}}
\newtheorem{theorem}{Theorem}
\begin{document}
\[
\renewcommand{\arraystretch}{1.25}
\begin{array}{@{}l@{\quad}l@{}}
\begin{array}{lllllllll}
& & & & &a & a & a &a\\ % RHS
& & & & & & b & b & b \\ % RHS
& & & &c& c& c &c& c % RHS
\end{array} & \twolinebrace\text{d} \\
\begin{array}{lllllllll}
& & & & a &a & a & a &a\\ % RHS
& & & & & b & b & b & b \\ % RHS
& & & c&c& c& c &c& c % RHS
\end{array} & \twolinebrace\text{d}
\end{array}
\]
\end{document}