Grasshopper

algorithmic modeling for Rhino

Retrieve specific values from list, which are closest to particular values?

Few months ago I had this problem:

I have a two lists with some data (list1 and list2). What I want to do is to identify the index of a number from a list1, which is the closest one to some number I am looking for - let's call it: reference number. By identifing the index, I could use data from other lists2 with the same index:

Danny Boyes and Hannes Löschke helped me with solution back then.
But this method works only when I have one requested reference number.



Now I would like to do the same thing, but with several reference numbers. Or to be precise I want to have several reference numbers in the same list. I do not want to copy the same code for each requested number.
Is there any other way this can be solved?

Thank you.

Views: 357

Attachments:

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2026   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service