Grasshopper

algorithmic modeling for Rhino

Replace (not remove) items based on another list of indices

I have a list of numbers on the left which I want to use as the indices to replace items from the list on the right.  I just need them to be null or zero or something so that that data doesn't generate geometry, but the indices of the rest of the data need to remain intact so that they correspond with many other lists.  I've hit a wall of frustration so any help would be great!

 

Views: 5414

Replies to This Discussion

One way would be to use the Pick 'n' Choose component. You would have to have a list with the same length as the original but filled with the the values to replace. Then generate a pattern of 0's and 1's in the order you want items replaced. I have used the Flip Matrix/Mass Addition components to get this as one list in this example.

It's important to note the Graft and Flatten Arrows.

wow, works great, thanks so much!
here's another approach with a little script - just input the data to process and the indices of the items to make null.
Attachments:

Split tree is also an option:

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