I have one variable of type double that has in it stored 5 ‘values’.
How do I get them out so I can add them?
(this is a gif; if it doesn’t auto-play, click on it)
then you can loop through them
double sum = 0;
foreach (double n in x)
sum += n;
2 Likes
That does not make it a lot clearer. I think you’d better post your file.
1 Like
Show.gh (5.7 KB)
Now I’m even more confused as to what you are trying to do…your component works just fine.
Did you just wanna add the results of the p2p distances? If so, try this.
Show_ww.gh (10.9 KB)
2 Likes
Thank you very much! You are right, it works perfectly
I guess I was just confused with the n.
foreach (double n in x)
sum += n;
(I just started with c#).
I don’t get where the name of the variable comes from and what it represents.
I was doing (in the case of my code):