Grasshopper

algorithmic modeling for Rhino

Can anyone tell me why the item component is returning index 4 from this list?

Views: 742

Replies to This Discussion

Well I was able to get it to work with Member Index component,but still don't know why the Index component didn't work.

 It will be work if you choose or separate the element(s) anyway from ORIGINAL list.....

Index it can only find the object with same ID, but actully, you new 40.0 is not the same ID object as 40.0 in the list. What you need to use is the component find similar.

Yeah I can get it work by extracting 40.0 from the list and using the index component on that element.  Thanks

Dennis 

To elaborate a bit more, the [Find Similar] component performs value comparisons whereas the [Item Index] component performs address comparisons.

Benefits of Find Similar:

  • Works sort of as you'd expect.

Benefits of Item Index:

  • Works on all data types, not just simple comparable ones.
  • Is able to distinguish between two different items that have the same value.

Basically the only times you need [Item Index] is if you've performed some sort of complicated operation on your data and you need to reverse engineer the permutations. [Item Index] allows you to create a mapping table from data in some modified collection to data in some unmodified collection, only presuming it is the exact same data.

--

David Rutten

david@mcneel.com

Tirol, Austria

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service