# ReplaceObjectAction class

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

```cs
[IoId("00000000-56e1-4b3c-9f6a-8c07d24a91b5")]
[UiName("Replace Object")]
public sealed class ReplaceObjectAction : Action
```

An undo action for swapping one document object for another which shares its instance ids. This is what placeholder resurrection records; because the ids are identical on both sides, the wires of surviving neighbours remain valid across undo and redo without any disconnection bookkeeping.

## Constructors

- [ReplaceObjectAction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.actions.replaceobjectaction/ctor.md): (2 overloads) Create a replacement record. Note that this action does not perform the initial swap, it only stores the data needed to undo and redo it.

## Properties

- [InstanceId](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.actions.replaceobjectaction/instanceid.md)

## Methods

- [PerformRedoInternal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.actions.replaceobjectaction/performredointernal.md)
- [PerformUndoInternal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.actions.replaceobjectaction/performundointernal.md)
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.actions.replaceobjectaction/store.md)

## Inherited Members

- From [Action](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action.md): [Response](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/response.md), [State](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/state.md), [Extends](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/extends.md), [PerformRedo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/performredo.md), [PerformUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/performundo.md), [PrepareRedo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/prepareredo.md), [PrepareRedoInternal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/prepareredointernal.md), [PrepareUndo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/prepareundo.md), [PrepareUndoInternal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.undo.action/prepareundointernal.md)
