# Tree class

Namespace: [Grasshopper2.Data](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.data.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
[DebuggerDisplay("Tree p:{Paths.Count} i:{LeafCount}")]
public sealed class Tree : ITree
```

A non-generic data tree.

## Properties

- [AllItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/allitems.md): Enumerate over all items in this tree.
- [AllPears](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/allpears.md): Enumerate over all item/meta data pears in this tree.
- [AllTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/alltwigs.md): Enumerate over all twigs in this tree.
- [CommonMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/commonmetadata.md): Gets the non-conflicting meta data inside this tree.
- [Description](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/description.md): Gets a string describing the topology of this tree.
- [ItemCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/itemcount.md): Gets the total number of non-null items in this tree.
- [Items](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/items.md): Access the items in this tree.
- [LeafCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/leafcount.md): Gets the number of leaf items in this tree (this includes all items and all nulls).
- [MetaCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/metacount.md): Gets the number of meta data entries.
- [NonNullItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/nonnullitems.md): Enumerate over all non-null items in this tree.
- [NonNullPears](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/nonnullpears.md): Enumerate over all non-null item/meta data pears in this tree.
- [NullCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/nullcount.md): Gets the total number of null items in this tree.
- [PathCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/pathcount.md): Gets the number of paths (and thus twigs) in this tree.
- [Paths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/paths.md): Access the paths of this tree.
- [Pears](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/pears.md): Access the pears in this tree.
- [Twigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/twigs.md): Access the twigs in this tree.
- [Type](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/type.md): Gets the type of the data stored in this tree.
- [TypeAssistant](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/typeassistant.md): Gets the type assistant (if any) associated with the type constraint. More derived types that are stored in this tree may have more specific type assistants.
- [TypeFlavour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/typeflavour.md): Gets some information about the generic type parameter of this tree.

## Methods

- [ConvertItems<Q>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/convertitems.md): Modify all items in this tree.
- [ConvertPears](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/convertpears.md): (2 overloads) Modify all pears in this tree.
- [Filter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/filter.md): (2 overloads) Apply a collection of rules to all the twigs and all the items in this tree.
- [Flatten](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/flatten.md): (2 overloads) Flatten the entire tree.
- [Flip](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/flip.md): Flip the tree by exchanging the twig indices of all items with one of the path elements.
- [GetCoverage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/getcoverage.md): Gets the part of a tree that is implied by a specific coverage.
- [Graft](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/graft.md): Perform a graft operation on the entire tree.
- [IsCoincidentWith](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/iscoincidentwith.md): (2 overloads) Test whether a given coverage coincides with this tree.
- [NullAt](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/nullat.md): (2 overloads) Gets whether a specific item is null or not.
- [PathExists](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/pathexists.md)
- [PathIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/pathindex.md)
- [ReplacePath](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/replacepath.md): Replace one path with another. If the replace path already exists within the tree, the items will be appended to the existing twig.
- [Similarity](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/similarity.md): Compares two data trees for similarity.
- [Split](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/split.md): (2 overloads)
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/tostring.md): (2 overloads) Returns a string that represents the current object.
- [TryConvert<TQ>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/tryconvert.md): (3 overloads) Try and convert this tree into a tree of a specific type.
- [WithIncrementalPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withincrementalpaths.md): Simplify the numbering of paths by starting at zero and incrementing by one for each element in the sequence.
- [WithMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withmetadata.md): (2 overloads) Merge all data from another tree.
- [WithoutEmptyTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withoutemptytwigs.md): Remove all twigs that contain no items from this tree.
- [WithoutMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withoutmetadata.md): Clear all meta data from all twigs, but leave items intact.
- [WithoutNullItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withoutnullitems.md): Remove all null items from all twigs.
- [WithoutPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withoutpaths.md): (2 overloads) Remove all specified paths and corresponding twigs.
- [WithoutSites](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withoutsites.md): (2 overloads) Remove all specified sites from the tree.
- [WithPathPrefix](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withpathprefix.md): (2 overloads) Prepend an integer to all paths in the tree.
- [WithPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withpaths.md): Create a new tree with different paths but the same twigs.
- [WithPathSuffix](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withpathsuffix.md): (2 overloads) Append an integer to all paths in the tree.
- [WithRandomisedTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withrandomisedtwigs.md): (2 overloads) Randomise the items within the twigs of this tree.
- [WithRenumberedPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withrenumberedpaths.md): (3 overloads) Renumber all paths in this tree in ascending order.
- [WithReversedTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withreversedtwigs.md): Reverse the order of all the items in the twigs of this tree.
- [WithSimplifiedPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withsimplifiedpaths.md): Perform a simplify operation on this tree.
- [WithSite](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withsite.md)
- [WithSortedTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withsortedtwigs.md): Sort all twigs using the default comparer.
- [WithTopology](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withtopology.md): Copy the topology of another tree while keeping the data from this tree. For a successful topology copy, the source and the target trees must have the same number of items.
- [WithTrimmedPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree/withtrimmedpaths.md): (2 overloads) Trim the tree by removing the last element in each path and merging twigs together.
