## XSIApplication.OpenUndo

### Introduced

v10.0 (2012)

### Description

Opens an undo complex. An undo complex can be used to undo/redo multiple undoable commands in one single operation. Once an undo complex is opened, all subsequent undoable command calls will be added to this complex. The XSIApplication.CloseUndo method should be called to close an opened complex.
OpenUndo is not meant to be used as a replacement for custom commands though but can be used in specific scenarios where the use of custom commands is not necessary. For instance, firing a script from a custom menu item could be done with an undo complex without the need of writing a custom command for undoing the whole script in one go.
Note:Undo complexes left opened due to a missing CloseUndo call may lead to undo/redo problems. However, Softimage will try to close automatically any opened undo complexes when possible.

### C# Syntax

    XSIApplication.OpenUndo( String in_sComplexName );

### Scripting Syntax

    XSIApplication.OpenUndo( ComplexName );

### Parameters

Parameter | Type | Description
--- | --- | ---
ComplexName | String | Name of this complex displayed in the Softimage undo menu.

### Examples

#### Python Example

    #
    # Simple example to deomonstrate OpenUndo/CloseUndo
    #
    Application.OpenUndo("my undo complex")
    Application.CreatePrim("Cone", "MeshSurface", "", "")
    Application.CreatePrim("Grid", "MeshSurface", "", "")
    Application.CreatePrim("Cube", "MeshSurface", "", "")
    Application.CloseUndo()
    Application.Undo("")    # my undo complex
    Application.Redo("")    # my undo complex