Linear pattern with different part lengths

Hello, i'm trying to make an assembly with around 95 parts with the same cross section but with different lengths.

I want these lengths to be controlled by a boundary. Like in the picture, the thick lines represent the parts and the thin lines the boundary.

I want the only variable to be the normal distance between the parts.

I tried to use a line linear to the part and mating the end points to a profile but this didnt work.

What do i need to do??

Kind regards

SolidworksAssemblies