generative modeling for Rhino
Hi,
I am getting a hair-pulling error using the VB.NET scripting module. Basically, I am trying to write a script that recursively applies a function onto a list until all of that lists elements are used up. One of the global variables I created is a new list ("Dim haystack As New List(Of Curve)), but when I try to populat that list using the AddRange method...I get this weird error! I was hoping someone might have insight; images and gh file attached.
Tags:
Permalink Reply by AZ on June 15, 2012 at 4:17am 
I haven't tried your code. But in general, if you are going iterate through a collection (list) and remove elements, you should be stepping though the list in descending order.
For example:
For i as Integer = haystack.Count - 1 to 0 Step -1
' TODO...
Next
-- Dale
Permalink Reply by AZ on June 15, 2012 at 12:57pm Thanks for pointing that out! I fixed it, but I'm still getting that error. It occurs at the second line of code:
"haystack.AddRange(surf)"
When I comment that out, it disappears. Any idea why it might be happening? It doesn't seem to be because haystack is defined below the sub...not sure what else could cause it.
Could it have something to do with the fact that the VBScript module can only declare global static variables?
Added by Mgeorgio 0 Comments 0 Likes
Added by Mgeorgio 0 Comments 0 Likes
© 2013 Created by Scott Davidson.
Powered by