Grasshopper

algorithmic modeling for Rhino

data tree, adding elements of different branches to a new list

hi all,

I have a list which includes 5 branches. What I want is a new list where I will have the sum (addition) of all the 1st values of the 5 branches, then the sum of all the 2nd values of the 5 branches. Should I use path mapper? Any suggestions?

Thanks

Views: 2070

Replies are closed for this discussion.

Replies to This Discussion

I have a list which includes 5 branches.

No you don't. A branch is a list with the associated path. Or sometimes it's just the same as a list. What you probably have is a tree with 5 branches, and each branch contains a collection of numbers.

If all branches are the same length, you can use Flip Matrix to get a new tree which contains a branch with all the first items, and another branch with all second items, etc. etc. However this is only possible when the paths are simple enough. If they're not, you'll have to modify that first.

Thanks for your reply David.

Yes you are right, it s a tree with 5 branches, with some thousands of values each. Flip Matrix is helpful to gather all needed values in a branch (12800 in total), but then how do I add the values of each branch to get a list of 12800 sums?

The component is "Mass Addition"

Cool!Thx

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service