Repository.Model.DeleteModel

From ReliaWiki
Revision as of 16:59, 26 March 2015 by John Leavitt (talk | contribs) (Created page with '{{Template:APIClass|Repository Class|Repository}} {{Template:Repository.DeleteModel.Cmt}} == Syntax== DeleteModel({{APIPrefix|ByVal}} ID {{APIPrefix|As Integer}}) {{APIPrefix|As…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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