# Node class

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

```cs
public sealed class Node
```

Represents a single node in an undo history. A node contains an undo record, as well as parent/child relationships with adjacent nodes.

## Properties

- [Children](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/children.md): Enumerate over all existing child nodes, starting with the youngest one.
- [Depth](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/depth.md): Gets the number of steps between this node and the Root.
- [IsRoot](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/isroot.md): Gets whether this node is a root node.
- [Parent](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/parent.md): Gets the parent node, if any.
- [ParentIfNotRoot](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/parentifnotroot.md): Gets the parent node, provided the parent isn't a root node.
- [PrimaryChild](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/primarychild.md): Gets the primary child, if defined.
- [Record](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/record.md): Gets the undo record contained in this node.
- [SecondaryChildren](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/secondarychildren.md): Enumerate over all secondary children.

## Methods

- [AllDescendants](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/alldescendants.md): Find all descendants of this node.
- [IndexOf](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/indexof.md): (2 overloads) Gets the index of a specific node within the child list.
- [IsDescendantNode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/isdescendantnode.md): Gets whether the specified node is a descendant of this node.
- [IsPrimaryNode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/isprimarynode.md): Gets whether the specified node is a primary child node of this node.
- [IsSecondaryNode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/issecondarynode.md): Gets whether the specified node is a secondary child node of this node.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.node/tostring.md)
