Grasshopper

algorithmic modeling for Rhino

Well friends

I have N trees (in this case shown : 4) each of them is like this one:

I want to create a tree with N branches: the 1st has all the 1st branch items, the 2nd all the 2nd branch items and so on.

Why this VB doesn't work?

Private Sub RunScript(ByVal L1 As DataTree(Of Point3d), ByVal L2 As DataTree(Of Point3d), ByVal L3 As DataTree(Of Point3d), ByVal L4 As DataTree(Of Point3d), ByRef A As Object)

    Dim component As IGH_Component = TryCast(owner, IGH_Component)
    If (component) Is Nothing Then Return

    For Each param As IGH_Param In component.Params.Output
      param.VolatileData.Clear()
    Next

    Dim M As New List ( Of List (Of Point3d))
   
    Dim i As Int32
    Dim j As Int32
   

    i = 0
    j = 0

    While i <= L1.Paths.Count
      'NOTE: All L1,L2... lists have the same number of paths and in this case j=0
     

      Dim pts As New List (Of point3d)
     
      pts.Add(L1(L1.Path(i), j))
      pts.Add(L2(L2.Path(i), j))
      pts.Add(L3(L3.Path(i), j))
      pts.Add(L4(L4.Path(i), j))

      M.Add (pts, New GH_Path(0, i))

      i = i + 1
    End While
    A = M
  End Sub

Views: 81

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service