Relative item component not collecting data

Hello, can anyone guide me why the relative item component is not collecting any data in my grasshopper script? Thank you


GCODE EXPERIMENT.gh (69.7 KB)

Not at my computer but it has to do with the format of the offset input.

Try {1}(0) or {1;0}(0)

2 Likes

Hello, thank you for your reply. It worked with {1;0}(0) but what is (0) for? in all the tutorials or texts I read I have never seen this format

1 Like

The {1;0} is the offset on the paths and has to match the depth of your tree. 1 means the result is on the next branch. (0) is for the indices. So 0 is the same item in the next branch. +1 would be the second item in the following branch.

Thats bit confusing because then if we need relative item that is second in list in pave of {1,0}(1) wouldn’t we write {2,0}

I tried {1,1}(1) the next item

{2;0} skips one branch

Take a look at the Modelab primer I think there’s a visual explanation. I’m using a phone right now and cannot open the primer.

https://modelab.gitbooks.io/grasshopper-primer/content/1-foundations/1-1/0_hello-grasshopper.html

Thank you very much. I will go through it , appreciate you help.

If I’m not completely wrong your tree structure is like this, without using simplify:

{0;0}
{1;0}
{2;0}

In that case you cannot use an offset of {1;1} since there are just three branches

1 Like

I think I need to understand relative item as a component well First. I am sure I am not understanding something crucial. So will go through the resource you have shared with me.Though I grafted that tree output you mentioned.

First step would be to learn about data trees.

You have 3 circles with 4 items each. The P output of the divide curve component doesn’t need to be grafted for the relative item component to work.

I was following this video actually, so tried accordingly. But thank you I got your point now about my items and branches.