Grasshopper

algorithmic modeling for Rhino


Why each 24 indexes disappear the code when performing?

Code here is this

 

Private Sub RunScript(ByVal x As List(Of String), ByVal nPaths As Integer, ByVal nItem As Integer, ByRef A As Object)
    Dim tree As New DataTree(Of String)
    Dim sum As Integer = 0
    Dim nCurrItem As Integer = nItem
    Dim j As Integer = 0
    For i As Integer = 0 To nPaths - 1

      Dim path As New GH_Path(i)
      For j = sum   To  nCurrItem - 1
        tree.Add(x(j), path)
      Next
      sum = j
      nCurrItem += nItem
    Next

    A = tree

 

Views: 222

Replies to This Discussion

I can't tell if its something wrong with your code as i am a newbie when in comes to Scripting but from your screen capture you have 25 indexes coming in but you only input 24 into the nPaths input of your script so it is not counting the final one. Though i maybe wrong.

Matt
Here is I have changed importance Paths on 25, changed only number Paths. Each 24 indexes on former is lost.

This is code working (dont working?) in GH 0.6

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service