Grasshopper

algorithmic modeling for Rhino

Hi all,
How do I specify a multi layered path in a GH custom component?

I know we can do this

Dim CurrentPath as new GH_Path(1)
TreeList.ad(xxx,CurrentPath)


How do we do something like this?

Dim CurrentPath as new GH_Path(1,1,1)

Do we have to do a tree of a tree?


Thanks

Kermin

Views: 411

Replies to This Discussion

Hi Kermin,

do it just like you typed. The GH_Path constructor takes any number of integers you care to feed it.

Dim p0 As New GH_Path(0)
Dim p1 As New GH_Path(0, 1)
Dim p2 As New GH_Path(0, 1, 5, 3, 2, 8, 1)


These are all valid constructors.

You can also append indices to an existing path:

Dim p_base As New GH_Path(0)
Dim p0 = p_base.AppendElement(0)
Dim p1 = p_base.AppendElement(1)


in which case p0 and p1 will be {0;0} and {0;1} respectively

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks David. That seems simple enough. I must have had been using the wrong kinds of "," before.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service