Equation driven pattern

I am trying to find a way to have Hole Wizard drive the number of holes in a part based on overall length(see attached image).

I would like add an equation to a pattern that will drive part count (Z) by overall length (X) so that the spacing (Y) is between 12.000 and 16.000.

I have to believe that other people have tried something similar?

Addtionally, I would like to drop this into a Library Feature and was wondering if that would cause any issue?

SolidworksSketching