DataTree<T>.Insert not equal to Insert Items component

Working with DataTree.Insert Method I´ve found the same behavior of Replace Item Component.
I´d like to know how to replicate via script the Insert Items Component. Any idea? Thanks.

that looks at least like a bad naming for me. (or even a bug ?)
just a very fast script - accessing the list via Branch and then insert in this list works like you expected.
Make sure to test wether the branch exists / the list was successfully found (i did not…)

x.Insert(y, x.Paths[1], 2); // Replace - unexpected
x.Branch(x.Paths[2]).Insert(2, y); // insert in list

Datatree_insert_00.gh (12.0 KB)

hope this helps, kind regards, -tom

1 Like