algorithmic modeling for Rhino
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.
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 i as Integer = haystack.Count - 1 to 0 Step -1
Thanks for pointing that out! I fixed it, but I'm still getting that error. It occurs at the second line of code:
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?