How to create a parametric curtain grid in custom curtain system?

Hi everybody,
I am new in dynamo. I am trying to create a parametric custom curtain system. I would like to manage distances between horizantal girdlines and vertical gridlines. ( d1, d2, d3 on image )
How can I do ? Can you share a graph or image ?