# How can i make 'redo' & 'undo'?

**URL:** <https://discourse.slicer.org/t/how-can-i-make-redo-undo/30836>\
**Category:** Development\
**Tags:** python\
**Created:** [July 28, 2023, 12:04am UTC](https://discourse.slicer.org/t/how-can-i-make-redo-undo/30836 "2023-07-28T00:04:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsa934](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dsa934/32/17907_2.png) [@dsa934](https://discourse.slicer.org/u/dsa934)\
**Post date:** [July 28, 2023, 12:04am UTC](https://discourse.slicer.org/t/how-can-i-make-redo-undo/30836/1 "2023-07-28T00:04:31Z")

</div>

Operating system: window 10  
Slicer version: 5.2.1

Hi, slicer users

I want to make redo & undo functions related to location movement in fiducialnode in 3d slicer.  
Is there any example or code I can refer to?

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [July 28, 2023, 12:57am UTC](https://discourse.slicer.org/t/how-can-i-make-redo-undo/30836/2 "2023-07-28T00:57:38Z")

</div>

Your previous post has the how-to for undo/redo for markups fiducial nodes. If something is still not working for you I recommend that you continue the discussion over there with what you tried and what you expected to happen.

> [@Custom Undo/Redo develop](https://discourse.slicer.org/t/custom-undo-redo-develop/27368):
>
> Operating system: window 11 Slicer version: slicer 5.2.1 Q1. After searching various materials, it was said that the undo/redo function for all nodes drawn in the scene is difficult to implement. Is this true? Q2. If so, I want to create a redo and undo function for a specific node (markupFiducial, Closedcurved). # Enable undo for the scene slicer.mrmlScene.SetUndoOn() # Enable undo for markups fiducial nodes defaultMarkupsNode = slicer.mrmlScene.GetDefaultNodeByClass("vtkMRMLMarkupsFiduc…
