Grasshopper

algorithmic modeling for Rhino

Hi,

This is a rather basic question. But I would like to merge three lists according to three lists of initial indicies each Item has. Combine Data and Merge Lists dont give the desired output.

Which would be the best way to get this done?

Views: 547

Attachments:

Replies to This Discussion

If you use the "list item" component, with your list and desired indexes, it should pick out the strings you want. If you still want to merge them after that you could use the "flatten" or "merge" component.

Hi Tim,

Thanks for your reply. In fact List Item doesnt work in this case, because I have three complete lists and the three lists of indicies remark the positions in the final list in which the strings have to go to. In this case it doesnt help me to pick the Strings according to the list below.

Not too sure what you mean. What if plug your "Initial List of Strings" in the A input of the "sort" component you already have? The A output should be sorted according to your indexes. (except I tried it and your Initial List of Strings is not the same length as your 3 initial indexes, seems you are have one too many or one too few).

Does this work?

Hi Tim,

I´m not sure if I got you right. Yes indeed there is one String in the right part which is double. Nevertheless could you post your gh file online to let me see how you have done it?

I'm at work and can't upload files.... (rolls eyes). Sorry

Do you mean like this? If so, you just need to order your inputs into the merge correctly...flattening the data ensures that data structure doesn't make your lists discrete from one another.

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