6. (10 points) As shown in the figure, divide a line segment $AB$ of length 9 into 9 equal parts. Then the total length of all line segments in the figure is ( )
A. 132
B. 144
C. 156
D. 165
【Analysis】There are 9 line segments of length 1, 8 line segments of length 2, 7 line segments of length 3, 6 line segments of length 4, 5 line segments of length 5, 4 line segments of length 6, 3 line segments of length 7, 2 line segments of length 8, and 1 line segment of length 9. Adding the lengths will give the solution.

【Solution】Solution: There are 9 line segments of length 1, 8 line segments of length 2, 7 line segments of length 3, 6 line segments of length 4, 5 line segments of length 5, 4 line segments of length 6, 3 line segments of length 7, 2 line segments of length 8, and 1 line segment of length 9,

The total length of all line segments in the figure is:
$$
\begin{array}{l}
1 \times 9 \times 2+2 \times 8 \times 2+3 \times 7 \times 2+4 \times 6 \times 2+5 \times 5, \\
=18+32+42+48+25, \\
=165 .
\end{array}
$$

Answer: The total length of all line segments in the figure is 165.
Therefore, the correct choice is: D.