'
' This example demonstrates how to test the DataRepository
' to test whether an object exists
'
NewScene , false
dim nIdentifier
' Create a cone and then test its existence
set oDatabase = XSIUtils.DataRepository
set oCone = CreatePrim( "Cone", "MeshSurface" )
nIdentifier = oDatabase.GetIdentifier( oCone )
Application.LogMessage oDatabase.HasData( nIdentifier )
'INFO : True
' Remove the cone and test its existence again
DeleteObj( "Cone" )
Application.LogMessage oDatabase.HasData( nIdentifier )
'INFO : False
' Restore it and test again
Undo
Application.LogMessage oDatabase.HasData( nIdentifier )
'INFO : True |