Repository.Model.DeleteModel
Jump to navigation
Jump to search
Checks if the model is not in use and deletes the model. Returns true if success, false otherwise. Throws an exception if the model is in use.
Syntax
DeleteModel(ByVal ID As Integer) As Boolean
Parameters
- ID: The ID to delete.
Usage Example
'Declare a new repository connection object. Dim MyRepository As New Repository 'Connect to the Synthesis repository. Dim Success As Boolean = False Success = MyRepository.ConnectToRepository("RepositoryFileNamePath") 'Get the list of models in the connected repository. Dim ListOfModels() As NameIdPair ListOfModels = MyRepository.GetAllModelsInfo() 'Retrieve the model with ID = 20. Dim AModel as cModel AModel = MyRepository.GetModel(20) 'Delete Model. MyRepository.DeleteModel(20) 'Disconnect from the repository. MyRepository.DisconnectFromRepository