What is the correct input format for defining data tree paths by string inputs? I have some basic code that is supposed to take in a tree, number of branches and number of items then divide the flattened tree by the number of items per branch. It's pretty basic code, but I can't seem to get the string input to generate the correct paths. Any help is appreciated. I placed a Print() after the strTemp variable and it appears to be producing the correct path numbering (at least as far as I understand how they are supposed to be) as the number slider inputs change so I pretty sure the code is good, I just can't find the string format to create the correct paths.
Private Sub RunScript(ByVal L As DataTree(Of Object), ByVal P As Integer, ByVal I As Integer, ByRef A As Object)
Dim objList As New DataTree(Of Object)
Dim objPath As New GH_Path
Dim iP, iI As Integer
Dim strTemp As String
iP = 0
iI = 0
strtemp = ""
For Each it As Object In L.AllData
strTemp = "(" & iP & "," & iI & ")"
objPath.FromString(strTemp)
objlist.Add(it, objPath)
If iI < I - 1 Then
iI = iI + 1
Else
iI = 0
If iP = P - 1 Then
Exit For
Else
iP = iP + 1
End If
End If
strTemp = ""
Next it
A = objList
End Sub
Tags: