I am trying to script a data tree of integers.
Within a loop, I would like to use an item I assigned to a previous branch in a new one. I can't figure out how to retrieve the item from the tree. Can you help?
below is the vb script. the bold section is where I am trying to retrieve the integer I assigned to Path(0) index (1) to use in path(1) index (0).
Thanks for your help!
__________________________________________________________________________________
Private Sub RunScript(ByVal gen As Integer, ByRef A As Object)
'your code goes here…
Dim tree As New DataTree(Of Integer)
Dim i As Integer
Dim j As Integer
For i = 0 To gen
If i = 0 Then
Dim path As New GH_Path(i, j)
Dim myrow As New List(Of Integer)
myrow.Add(0):myrow.Add((2 ^ (gen - 1)) / 2)
For j = 0 To myrow.Count() - 1
tree.add(myrow(j), path)
Next
Else If i = 1 Then
Dim path As New GH_Path(i, j)
Dim myrow As New List(Of Integer)
Dim g As Int32 = tree.item(path(0), 1)
myrow.Add(g / 2)
For j = 0 To myrow.Count() - 1
tree.add(myrow(j), path)
Next
Else
'Dim path As New GH_Path(i, j)
'tree.add(myrow, path)
End If
Next
A = tree