Undo.1.vbs Example

Applies To

Undo command

Description

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)

Code

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

Keywords

Undo


Autodesk Softimage 2011