parameters: (sender, e)
docstring: !!!!!!!!!!
      NEVER change any setting in the Rhino document or application.  Rhino
      handles ALL changes to the application and document and you will break
      the Undo/Redo commands if you make any changes to the application or
      document. This is meant only for your own private plug-in data
      !!!!!!!!!!
  
      This function can be called either by undo or redo
      In order to get redo to work, add another custom undo event with the
      current value.  If you don't want redo to work, just skip adding
      a custom undo event here
docstring_summary: !!!!!!!!!!
      NEVER change any setting in the Rhino document or application.  Rhino
      handles ALL changes to the application and document and you will break
      the Undo/Redo commands if you make any changes to the application or
      document. This is meant only for your own private plug-in data
      !!!!!!!!!!
docstring_tokens: !!!!!!!!!! NEVER change any setting in the Rhino document or application . Rhino handles ALL changes to the application and document and you will break the Undo / Redo commands if you make any changes to the application or document . This is meant only for your own private plug - in data !!!!!!!!!!
function: def OnUndoFavoriteNumber(sender, e):
      """!!!!!!!!!!
      NEVER change any setting in the Rhino document or application.  Rhino
      handles ALL changes to the application and document and you will break
      the Undo/Redo commands if you make any changes to the application or
      document. This is meant only for your own private plug-in data
      !!!!!!!!!!
  
      This function can be called either by undo or redo
      In order to get redo to work, add another custom undo event with the
      current value.  If you don't want redo to work, just skip adding
      a custom undo event here
      """
      current_value = scriptcontext.sticky["FavoriteNumber"]
      e.Document.AddCustomUndoEvent("Favorite Number", OnUndoFavoriteNumber, current_value)
  
      old_value = e.Tag
      print "Going back to your favorite =", old_value
      scriptcontext.sticky["FavoriteNumber"]= old_value;
function_tokens: def OnUndoFavoriteNumber ( sender , e ) : current_value = scriptcontext . sticky [ "FavoriteNumber" ] e . Document . AddCustomUndoEvent ( "Favorite Number" , OnUndoFavoriteNumber , current_value ) old_value = e . Tag print "Going back to your favorite =" , old_value scriptcontext . sticky [ "FavoriteNumber" ] = old_value