# New to Grasshopper (keeping relationships between numeric slides)

Hi I am new to Grasshopper. I finally decided to sit my ass on the chair and not give up this time.

I am trying to start with basic GH tutorials on the web. I really recommend: Rhino Grasshopper on you tube. I am following this tutorial: https://www.youtube.com/watch?v=G6NyEhPPQaU

I am trying to apply same principle to make a chocolate bar. Just to have fun and render it in Keyshot.
At the beginning of the tutorial he applies a Square Grid node (I am using a Rectangle one for the sake of the chocolate bar appearance). I would like to generate a “relationship” between the Size X and Size Y. I am trying to find the real size of a chocolate bar (standard one) I found the proportion by eye, but now I would like to keep the relationship and crank the sizes of the cells.

I am sure it is possible. Could anyone indicate me the way to “fix” a relationship between to numeric value slides ?

Thanks a lot : )

Hi Bruno,
Is this what you’re after?

Ratio Bruno.gh (7.8 KB)

you can divide the length and the width of the rectangle to the number of cells in x and y direction

This is what I am heading for:

I Will go for @siemen approach, coming back to you asap

I tried what you suggested @siemen but it is not respecting the fixed ratio. It is changing the proportions still…I can attach the file if that helps ?

Attaching a file always helps. You’re reusing the same numbers which you use to calculate the ration, which is why it isn’t working.

Edit: But wait, do you want to be able to change both values while they maintain the original proportion? or just 1 value to increase the size?

I am trying to move only size x slider and keep the proportion according only to that number.
So I would like to have always the same rectangle ratio and be able to tweak one of the size dimensions and keep the ratio but increase the scale in a way.

I know I should make another thread, but could you help me to understand why the loft is not happening also?
Thanks a lot and sorry for the inconvenience.

The file here:
Chocolate.gh (14.6 KB)

Have a look at the attached. The slider in the blue frame is for increasing the size.

You are trying to combine lists with a different path with each other. So instead of getting 30 lists with 2 items in them you get 60 lists with 1 item in it.

Simplifying the list before combining them solves it in this case.

Chocolate 2.gh (14.0 KB)

i think is better if you use scale at the end

Chocolate3.gh (8.6 KB)

That works as well but then you still need to add an extra step to be able to control the exact size in the x-direction.

he can do that ; the most important don’t lose height proportion when use the previous method

Chocolate3.gh (9.1 KB)

Thanks a lot Siemen. I have been checking my mistakes. I input the slider X also in the A/B node, therefore I was tweaking the relationship while touching the x slide…To sum up…I was being stupid.

In the video I am following they show that the lists gets paired for the loft by pressing “Graft” on the curve node. The video works…in mine not, but now I see the one you attached has the “simplify” .

I thought this video was so basic, apparently not to me. I think I need to start with something even more basic. Thanks so so much for your help.