Grasshopper

algorithmic modeling for Rhino

How can create branches inside VB Code without using other components

I want to reach a better understand of the branch and Data Tree inside scripting components.
Is it possible to organize the branch of this example inside VB component?
Thanks
Paolo

Forget D, Is it been eliminated in the definition.

Sister discussion here


delaunay_decoration_04.ghx


Views: 420

Replies to This Discussion

Hi Paolo,

sorry for the long silence.

This is actually a bit tricky in the current system, as DataTree(Of T) does not have an in-build Graft method, and Grasshopper.Kernel.Data.GH_Structure(Of T) does not accept data that doesn't implement IGH_Goo.

I'll add a Graft method to DataTree(Of T) for the next release, but here's a solution for the meantime:

Dim ln1 As New DataTree(Of Line)
Dim ln2 As New DataTree(Of Line)
Dim ln3 As New DataTree(Of Line)

For i As Int32 = 0 To Lines1.Count - 1
   ln1.Add(Lines1(i), New GH_Path(i))
Next
For i As Int32 = 0 To Lines2.Count - 1
   ln2.Add(Lines2(i), New GH_Path(i))
Next
For i As Int32 = 0 To Lines3.Count - 1
   ln3.Add(Lines3(i), New GH_Path(i))
Next

A = ln1
B = ln2
C = ln3


--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks David!!!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service