# History 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
[IoId("00000000-4a34-4f65-83ba-480c30841fb4")]
public class History : IStorable
```

Provides access to the undo/redo history of a Grasshopper document.

## Properties

- [CentralRedoSequence](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/centralredosequence.md): Enumerate over all the central redo nodes from the first to the final.
- [CentralUndoSequence](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/centralundosequence.md): Enumerate over all the central undo nodes from the first to the root.
- [Document](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/document.md): Gets the document this undo history is associated with.
- [FirstRedo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstredo.md): Gets the first node to be redone, if any.
- [FirstUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstundo.md): Gets the first node to be undone, if any.
- [IsEmpty](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/isempty.md): Gets whether this history contains any undo or redo records.
- [RedoActions](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/redoactions.md): Enumerate over all undo actions in the central redo sequence.
- [Root](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/root.md): Gets the root of this history.
- [UndoActions](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/undoactions.md): Enumerate over all undo actions in the central undo sequence.

## Methods

- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/clear.md): (2 overloads) Clear the entire undo and redo stacks.
- [Do](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/do.md): (5 overloads) Adds a new undo node to this history as the primary child of the current [History.FirstUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstundo.md) node. The new node will automatically become the new [History.FirstUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstundo.md) node and the [History.FirstRedo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstredo.md) field will go blank.
- [FindCreationAction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/findcreationaction.md): Find the youngest action in the central undo sequence which covers the creation of an object.
- [FindDeletionAction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/finddeletionaction.md): Find the youngest action in the central undo sequence which covers the deletion of an object.
- [FindDeletionRecord](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/finddeletionrecord.md): Find the youngest record in the central undo sequence which covers the deletion of an object.
- [Move](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/move.md): Move a node to a new parent.
- [Prune](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/prune.md): (2 overloads) Clear all non-central undo and redo records.
- [Redo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/redo.md): (2 overloads) Undo the [History.FirstUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstundo.md) record and adjust the [History.FirstUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstundo.md) and [History.FirstRedo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstredo.md) fields accordingly.
- [RedoActionsOfType<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/redoactionsoftype.md): Enumerate over all undo actions of a specific type in the central redo sequence.
- [Remove](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/remove.md): Remove a node and all its secondary children from this history, and connect the primary child to the parent if possible.
- [ShowHistory](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/showhistory.md): (2 overloads) Show the history of an existing canvas in a window.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/store.md)
- [Undo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/undo.md): (2 overloads) Undo the [History.FirstUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstundo.md) record and adjust the [History.FirstUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstundo.md) and [History.FirstRedo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/firstredo.md) fields accordingly.
- [UndoActionsOfType<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/undoactionsoftype.md): Enumerate over all undo actions of a specific type in the central undo sequence.

## Events

- [Modified](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/modified.md): This event is raised whenever the topology of the history graph is changed. The [History.Modified](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/modified.md) event always follows a more specific event such as [History.NodeAdded](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/nodeadded.md), [History.NodeMerged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/nodemerged.md) or [History.NodeMoved](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/nodemoved.md).
- [NodeAdded](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/nodeadded.md): This event is raised whenever a new node is added to the history. This event is always followed by the [History.Modified](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/modified.md) event.
- [NodeMerged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/nodemerged.md): This event is raised whenever a node is merged with its primary child. This event is always followed by the [History.Modified](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/modified.md) event.
- [NodeMoved](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/nodemoved.md): This event is raised whenever a node and all its child nodes are moved from one location in the history to another. This event is always followed by the [History.Modified](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/modified.md) event.
- [NodeRemoved](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/noderemoved.md): This event is raised whenever a new node and all its child nodes are removed from the history. This event is always followed by the [History.Modified](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/modified.md) event.
- [Redone](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/redone.md): This event is raised when a record is redone.
- [Undone](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.history/undone.md): This event is raised when a record is undone.
