Undo

Introduced

4.2

Description

Undoes the last undoable command in the command stack. This is the scripting equivalent of selecting Undo from the main Edit menu or pressing Ctrl+Z in the user interface.

Scripting Syntax

Undo( [Repetitions] )

Parameters

Parameter

Type

Description

Repetitions [in/out]

Integer

Number of times to undo. May stop earlier if there are no more commands to undo.

Default Value: 1

Examples

VBScript Example

'
'  This example demonstrates how to use the Undo option in scripting by 
'  using the DataRepository (internal object database) to see whether
'  the object exists in the scene at each step (creating the object, 
'  deleting, and then undoing the DeleteObj call)
'

NewScene , false
dim nIdentifier
set oDatabase = XSIUtils.DataRepository
set oCone = CreatePrim( "Cone", "MeshSurface" )
nIdentifier = oDatabase.GetIdentifier( oCone )

LogMessage oDatabase.HasData( nIdentifier )
'INFO : True

DeleteObj( "Cone" )
LogMessage oDatabase.HasData( nIdentifier )
'INFO : False

Undo
LogMessage oDatabase.HasData( nIdentifier )
'INFO : True

See Also

Redo



Autodesk Softimage v7.5