generative modeling for Rhino
How can i create a series like (a,(a+b),(a+b+c),(a+b+c+d)).
if i have a list of no. like a,b,c,d.
Tags:
Hello Yousuf,
You can use nested for-loops to do this. For example, inserting the following code snippet in the C# script component will do the trick! If you need any help in understanding the code, let me know.
for (int i = 0; i < givenSet.Length; i++)
{
resultingSet[i] = 0;
for (int j = 0; j <= i; j++)
{
resultingSet[i] += givenSet[j];
}
}
Cheers,
Sridevi
Permalink Reply by Mateusz Zwierzycki on May 25, 2012 at 1:33pm
Permalink Reply by Danny Boyes on May 25, 2012 at 1:50pm The Mass addition Component has a partial results output which will achieve the results you want.
Hahaha... such a simple solution! Too bad I cannot "up-vote" your answer like on http://stackoverflow.com
© 2013 Created by Scott Davidson.
Powered by