Grasshopper

algorithmic modeling for Rhino

hello,

please be aware that im still new to grasshopper (and VB) so please bear with me...

I'm feeding a VB component with a series of 3d points (a list with 4 items), I have identified the input as a List (Of point3d); the question is... how can I extract each point as an independent variable in VB?... in lemming terms -for me- I want to do the same as what the List Item component does in GH... if this makes sense.

thanks for your time

sn

Views: 1380

Replies to This Discussion

Hi Sono,

you can use the Item property of List(Of T) to access individual elements:

Dim ptA As Point3d = points.Item(0)

Since the Item property is the default property, you don't even have to specifically call it:

Dim ptA As Point3d = points(0)

--

David Rutten

david@mcneel.com

Poprad, Slovakia

done!, Thanks David

errr... sorry David,

I copied the line of code as you noted but I wanted to check the output so I renamed one of my VB components outputs as ptA and I get the following error:

Error: 'ptA' is already declared as a parameter of this method. (line 87)


...obviously the output on ptA is 0<null>; I know is probably something very dumb and basic.

thanks again

sn

David... i figured it out!

thanks again

sn

Hi,

you say the Item property is the default property,

so what are the others properties ?

Because i have a list of point3d and i need to extract all the point one by one in a VBscript, is there a property in this case ?

Can you post some code?

You can use a For Each loop to iterate over all items in a list.

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