Site Tools


How To: Clear Rhino's Undo and Redo Lists

Developer: C++
Summary: Demonstrates how to clear Rhino's Undo and Redo lists.

Rhino allows users to undo the most recent or several create, edit, or transform commands. If you are performing editing operations on large memory consuming objects, Rhino's undo list can quickly grow very large. When this happens, most Rhino users run the ClearUndo command to clear the undo list. It is also possible to clear the undo list from within a plug-in.

The following sample code demonstrates how to clear Rhino's undo and redo lists.

C++

CRhinoCommand::result CCommandTest::RunCommand( 
        const CRhinoCommandContext& context 
        )
{
  RhinoApp().Print( L"Clearing undo and redo lists.\n" );
  context.m_doc.ClearUndoRecords( true );
  return CRhinoCommand::success;
}
developer/sdksamples/clearundo.txt ยท Last modified: 2014/06/26 (external edit)