# About Undo/Redo my data ? (C++/Rhino 5)

**URL:** <https://discourse.mcneel.com/t/about-undo-redo-my-data-c-rhino-5/12766>\
**Category:** Rhino Developer\
**Created:** [October 27, 2014, 8:37am UTC](https://discourse.mcneel.com/t/about-undo-redo-my-data-c-rhino-5/12766 "2014-10-27T08:37:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaicihuang](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/kaicihuang/32/110742_2.png) [@kaicihuang](https://discourse.mcneel.com/u/kaicihuang)\
**Post date:** [October 27, 2014, 8:37am UTC](https://discourse.mcneel.com/t/about-undo-redo-my-data-c-rhino-5/12766/1 "2014-10-27T08:37:06Z")

</div>

I declare a variable ,such as int m\_Procees , in myplugIn.h  
and it will be saved in 3dm file via myplugIn::WriteDocument() .

The problem happened after Undo command because it don’t undo the value of m\_Procees.

Example:  
m\_Procees = 1.  
The m\_Procees is changed to 3 by runing command\_A.  
Runing Undo command.  
The m\_Procees is still 3 ,not 1.

How to solve this problem ???

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [October 27, 2014, 3:19pm UTC](https://discourse.mcneel.com/t/about-undo-redo-my-data-c-rhino-5/12766/2 "2014-10-27T15:19:51Z")

</div>

Only Rhino document-based objects are undoable,not member variables on your plug-in object.

But, Rhino does support adding custom undo events. To learn how, review the following article.

> **[Custom Undo Events](http://developer.rhino3d.com/guides/cpp/custom-undo-events/)**
>
> This guide discusses custom undo events.
