Hi there,
I am new to VB and Grasshopper and I am trying to do a very basic
excercise but I canøt figure out how to get it done.
My problem is that I want add elements to a list of integers without
losing the existing order. When I use the array.add(i) command the
list output is sorted by size and useless to me. the thing I now tried
is to simply assign the value to a specific location in the array:
array(n)=i
This is where I get the following error:
Value of type 'integer' cannot be converted to
'system.collections.generic.List(of integer)
This is the code, the input variables are called 'endchord' and 'all'
and are both lists of on3dpoints:
'Declare and instantiate the for loop variables
Dim i As Integer = 0
Dim n As Integer = 0
Dim count As Integer
count = all.Count() - 2
Dim count2 As Integer
count2 = endchord.Count() - 1
Dim diagn As New On3dpoint
Dim alli As New On3dPoint
Dim listA(count2) As List(Of Integer)
'Loop through all points of diagonals
For i = 0 To count
alli = all(i)
For n = 0 To count2
diagn = endchord(n)
If diagn.x = alli.x Then
If diagn.y = alli.y Then
If diagn.z = alli.z Then
listA(n) = i
End If
End If
End If
Next
Next
A = listA
It should not be too hard, hope anyone can point me in the right
direction...