Grasshopper

algorithmic modeling for Rhino

I have a componenent that outputs ten lists, each consisting of ten elements. What I would like is to concatenate these lists, thus forming a list of 100 elements.

I'm used to programming, but Grasshopper and its data model is new to me. As far as I understand, when sending the output from this component into a VB component, the VB component would be working with one list at the time. As opposed to an array of ten lists (i.e. a two dimensional array).

The immediate solution in a "normal" programming environment would be to have a static/persistant list object that would keep the intermediate growing list, but this does not seem to be possible?

How would one solve this?

edit: in the attached picture you can see how the data I am working with looks, in case that might prove helpful.

Views: 560

Attachments:

Replies to This Discussion

To flatten all the data into a single list of 100 items, just right click on the input of the VB component and select "flatten".
If you want to work with an array of arrays inside the vb component, you'll have to recreate it yourself from the flat list of data by also inputting a list of numbers (using the list length component) that gives you the number of paths and number of items in each path
Thank you! That worked beautifully.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service