Grasshopper

algorithmic modeling for Rhino

Hello there,

I'm having an issue with adding something to a list in the vb component, perhaps one of you can help.
When running the List.add command, a new Object is not added to the end of the list, but also seems to affect/overwrite previous list entries....
Has anyone come across this? I've tried Arraylist etc, but it has the same problem...

My code goes something like this


'-----------

Dim List as List (Of Oncircle):


(here another function iteratively creates a circle - with centres (0,0,0); (0,0,1); (0,1,1), say)


each time a circle is created, I run:

List.Add (circle)


To test, I print the centres of the circles:

For i = 0 to List.Count()-1
Print List(i).Center
Next

'-----------

output:

0,0,0
0,1,1
0,1,1

where it should be

0,0,0
0,0,1
0,1,1

, no?

Thanks in advance for any help!

Dan

Views: 307

Replies to This Discussion

It's probably best to upload the whole code or the component with the inputs - just too difficult to see where the error occurs.

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