Append values to a specific path in the tree.
Array of integers representing the branch path (e.g., [0], [0, 1])
Values to append at this path
this for method chaining
Append flattened values to path [0]. Useful for simple flat inputs.
Single value or array of values
this for method chaining
Append a single value to a path.
Branch path
Single value to append
this for method chaining
Get the flattened list of all values in the tree.
Array of all values across all branches
Set values from a DataTreeDefault structure. Replaces any existing tree data.
TreeBuilder structure with path keys like "{0;1}"
this for method chaining
Get the parameter name.
Parameter name
Get values at a specific path.
Path to retrieve values from
Array of values or undefined if path doesn't exist
Get all paths in the tree.
Array of path strings
Convert to format compatible with Grasshopper Compute API.
InnerTree object ready for compute
StaticformatFormat a path array into TreeBuilder path string format.
Path as number array
Formatted path string like "{0;1;2}"
StaticfromCreate a TreeBuilder from a single InputParam.
Input parameter definition
InnerTree ready for compute or undefined if value is invalid
StaticfromCreate DataTrees from an array of InputParam definitions. Handles tree access, numeric constraints, and value parsing.
Array of input parameter definitions
Array of InnerTree instances ready for compute
StaticgetExtract a value from a TreeBuilder or InnerTree array by parameter name.
Automatically unwraps single values for convenience.
Works with both high-level DataTree[] instances and low-level InnerTree[] format.
Architecture Note:
DataTree[] to read builder instancesInnerTree[] to read compute API responsesReturn Value Behavior:
5 not [5])nullFor TreeBuilder instances
Array of TreeBuilder instances to read from
The parameter name to retrieve
The unwrapped value, array of values, or null if parameter not found
For compiled InnerTree
Extract a value from a TreeBuilder or InnerTree array by parameter name.
Automatically unwraps single values for convenience.
Works with both high-level DataTree[] instances and low-level InnerTree[] format.
Architecture Note:
DataTree[] to read builder instancesInnerTree[] to read compute API responsesReturn Value Behavior:
5 not [5])nullFor TreeBuilder instances
Array of TreeBuilder instances to read from
The parameter name to retrieve
The unwrapped value, array of values, or null if parameter not found
For compiled InnerTree
StaticparseParse a TreeBuilder path string like "{0;1;2}" into [0, 1, 2].
Path string
Array of path indices
StaticreplaceSet or replace a parameter value within a TreeBuilder or InnerTree array.
Supports both high-level DataTree[] instances and low-level InnerTree[] format.
Architecture Note:
DataTree[] when building/modifying before computationInnerTree[] when modifying compute API resultsDataTree is the high-level builder; InnerTree is the Rhino Compute formatFor TreeBuilder instances (high-level builder)
Array of TreeBuilder instances to modify
The parameter name to set or replace
The new value (scalar, array, or TreeBuilder structure)
A new/modified TreeBuilder array with the updated parameter
For compiled InnerTree (low-level API format)
Set or replace a parameter value within a TreeBuilder or InnerTree array.
Supports both high-level DataTree[] instances and low-level InnerTree[] format.
Architecture Note:
DataTree[] when building/modifying before computationInnerTree[] when modifying compute API resultsDataTree is the high-level builder; InnerTree is the Rhino Compute formatFor TreeBuilder instances (high-level builder)
Array of TreeBuilder instances to modify
The parameter name to set or replace
The new value (scalar, array, or TreeBuilder structure)
A new/modified TreeBuilder array with the updated parameter
For compiled InnerTree (low-level API format)
Standalone TreeBuilder class for constructing Grasshopper TreeBuilder structures. Does not depend on RhinoCompute library.
Example