Creating DataTree sub branches in C#

Hi everyone,

Is there a method to create the sub branches in C#?


Use EnsurePath(GH_Path) or Append(T, GH_Path)/ Add(T, GH_Path) depending on which one.

1 Like

What exactly is the question? (117.5 KB)


I think you use AppendElement for creating sub branches.

With regard the abstract demo cases … for a given path … path = path.AppendElement(i) adds another dimension. Prepend adds a new first dimension.

Obvioulsy - if required - you can create any sub-path imaginable suitable for your scope/case/data structure. Say:

path = new GH_Path(path.Indices[0], i, path.Indices[1], …)
path = new GH_Path(path.Indices[1], i, path.Indices[0], …)
etc etc.

See also GH_Path Members for the available possibilities.

BTW: given the opportunity - if required - you can use the GH_Lexer:

1 Like