Verifies if the specified Object, ID or GUID is present in the database. This is used for debugging purposes to find out whether an object is valid or not. Trying to work with an invalid object is a serious problem. In the case of ID or GUID, it may mean that the object has been deleted.
oBoolean = DataRepository.HasData( Object ); |
' ' 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 |