Step 1: Model the condition.
"All black boxes are consecutive" \(\Rightarrow\) the set of black boxes must form a single contiguous block (interval) among the 6 positions.
Step 2: Count all non-empty intervals among 6 positions.
Choose the start and end of the black block: for length \(1\) there are \(6\) choices; for length \(2\), \(5\) choices; \(\dots\); for length \(6\), \(1\) choice.
\[ \text{Total ways} = 6+5+4+3+2+1 = \frac{6\cdot 7}{2} = 21. \] \[ \boxed{21} \]