Grasshopper

algorithmic modeling for Rhino

Hi Everyone,

I am just starting out with GH and VB. If I have a list of values as an input is there a way using vb script to select certain values from that list? E.g if I have a list of 10 values how could i select values 2 and 5 from the list?

Thanks in advance.

Views: 389

Replies to This Discussion

Hi Axiom.
One rough thing I can think of would be to have your selected values in a list of integers (being those positions in the main list you would like to process) and call them in a loop.
In pseudocode:

Sub RunScript(ByVal Mainlist As List(Of Object), ByVal Selectlist As List(Of Integer))

Dim selectvalue as integer

for i as int32 = 0 to selectlist.count -1

selectvalue = selectlist(i)

process (

mainlist(selectvalue)

)

next

End Sub

'Here process would be whatever you would like to do with the mainlist items.

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