generative modeling for Rhino
How can i import a list generated by some other component in grasshopper inside a VB component ?
I assumed it worked as a 1D Array so created the following script, but it gave the error "Index was out of range: Must be a non-negative and less than the size of the collection : Parameter Name Index(line 0)"
Private Sub RunScript(ByVal x As List(Of Boolean), ByVal y As Object, ByRef A As Object)
Dim i , j , p As Integer
Dim arr1(y ,y) As int32
p = 0
For i = 0 To y
For j = 0 To y
If x(p) = True Then
arr1(i, j) = 1
Else
arr1(i, j) = 0
End If
p = p + 1
Next
Next
End Sub
Permalink Reply by Khizer Ishtiaq on January 3, 2012 at 2:58pm Here are the files...
Permalink Reply by Systemiq on January 4, 2012 at 11:55am If you have y elements in a collection, the index can go from 0 to y-1.
So: For i=0 to y-1 and For j=0 to y-1, or index will go out of range.
Permalink Reply by Khizer Ishtiaq on January 4, 2012 at 12:04pm Oh...that was causing all the problem... I was so focused on the way i called the list and assigned it to 2D array, that i missed the flaw in the logic...
Thanks alot SYSTEMIQ ...
© 2013 Created by Scott Davidson.
Powered by