# ITree interface

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
public interface ITree
```

Base level interface for Grasshopper data trees.

**Derived types:** [Tree](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree.md), [Tree<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.tree-1.md)

## Properties

- [AllItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/allitems.md): Enumerate over all items in this tree.
- [AllPears](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/allpears.md): Enumerate over all item/meta data pears in this tree.
- [AllTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/alltwigs.md): Enumerate over all twigs in this tree.
- [CommonMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/commonmetadata.md): Gets the non-conflicting meta data inside this tree.
- [Description](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/description.md): Gets a string describing the topology of this tree.
- [ItemCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/itemcount.md): Gets the total number of non-null items in this tree.
- [Items](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/items.md): Access the items in this tree.
- [LeafCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/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.itree/metacount.md): Gets the number of meta data entries.
- [NonNullItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/nonnullitems.md): Enumerate over all non-null items in this tree.
- [NonNullPears](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/nonnullpears.md): Enumerate over all non-null item/meta data pears in this tree.
- [NullCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/nullcount.md): Gets the total number of null items in this tree.
- [PathCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/pathcount.md): Gets the number of paths (and thus twigs) in this tree.
- [Paths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/paths.md): Access the paths of this tree.
- [Pears](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/pears.md): Access the pears in this tree.
- [Twigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/twigs.md): Access the twigs in this tree.
- [Type](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/type.md): Gets the type of the data stored in this tree.
- [TypeAssistant](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/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.itree/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.itree/convertitems.md): Modify all items in this tree.
- [ConvertPears](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/convertpears.md): (2 overloads) Modify all pears in this tree.
- [Filter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/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.itree/flatten.md): (2 overloads) Flatten the entire tree.
- [Flip](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/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.itree/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.itree/graft.md): Perform a graft operation on the entire tree.
- [IsCoincidentWith](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/iscoincidentwith.md): (2 overloads) Test whether a given coverage coincides with this tree.
- [NullAt](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/nullat.md): (2 overloads) Gets whether a specific item is null or not.
- [ReplacePath](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/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.itree/similarity.md): Compares two data trees for similarity.
- [Split](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/split.md): (2 overloads) Split this tree into a positive and a negative state by applying a collection of rules.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/tostring.md): Format this tree using a specific formatting template.
- [TryConvert<TQ>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/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.itree/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.itree/withmetadata.md): (2 overloads) Merge all data from another tree.
- [WithoutEmptyTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withoutemptytwigs.md): Remove all twigs that contain no items from this tree.
- [WithoutMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withoutmetadata.md): Clear all meta data from all twigs, but leave items intact.
- [WithoutNullItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withoutnullitems.md): Remove all null items from all twigs.
- [WithoutPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withoutpaths.md): (2 overloads) Remove all specified paths and corresponding twigs.
- [WithoutSites](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withoutsites.md): (2 overloads) Remove all specified sites from the tree.
- [WithPathPrefix](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withpathprefix.md): (2 overloads) Prepend an integer to all paths in the tree.
- [WithPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withpaths.md): Create a new tree with different paths but the same twigs.
- [WithPathSuffix](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withpathsuffix.md): (2 overloads) Append an integer to all paths in the tree.
- [WithRandomisedTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withrandomisedtwigs.md): (2 overloads) Randomise the items within the twigs of this tree.
- [WithRenumberedPaths](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withrenumberedpaths.md): (3 overloads) Renumber all paths in this tree in ascending order.
- [WithReversedTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/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.itree/withsimplifiedpaths.md): Perform a simplify operation on this tree.
- [WithSite](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withsite.md): Replace a single pear in this tree.
- [WithSortedTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/withsortedtwigs.md): Sort all twigs using the default comparer.
- [WithTopology](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.itree/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.itree/withtrimmedpaths.md): (2 overloads) Trim the tree by removing the last element in each path and merging twigs together.
