Repository.Model.GetAllModelsInfo: Difference between revisions
Jump to navigation
Jump to search
Alex Ulanov (talk | contribs) |
Kate Racaza (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{Template:APIClass|Repository Class|Repository}} | {{Template:APIClass|Repository Class|Repository}} | ||
{{Template:Repository. | {{DISPLAYTITLE:Model.GetAllModelsInfo Method}} | ||
{{Template:DeprecatedAPI|method|[[Repository.Model.GetAllModels]]}} | |||
{{Font|Introduced in Version 9<nowiki> | </nowiki>Member of SynthesisAPI.[[Repository_Class|Repository]]|8|Calibri|Bold|#424242}} | |||
Retrieves a list of all model resources in the current project and returns a [[NameIdPair_Class|NameIdPair]] object array that contains the ID number of each model. | |||
== Syntax== | == Syntax== |
Revision as of 23:23, 7 July 2015
This method has been deprecated and may be removed in future versions of the Synthesis API. Do not use it in new applications. Repository.Model.GetAllModels
Introduced in Version 9 | Member of SynthesisAPI.Repository
Retrieves a list of all model resources in the current project and returns a NameIdPair object array that contains the ID number of each model.
Syntax
- GetAllModelsInfo()AsNameIdPair()
Usage Example
In this usage example, the API is used to connect to a repository, retrieve one of the models in it and then calculate the reliability at a specified time, based on that model.
'Declare a new repository connection object. See Repository. Dim MyRepository As New Repository 'Connect to a Synthesis repository. Dim Success As Boolean = False Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr10") 'Get a list of the names/IDs of projects in the connected repository. Dim ListOfProjects() As NameIdPair ListOfProjects = MyRepository.Project.GetAllProjects() 'Open the first project in the list. MyRepository.Project.SetCurrentProject(ListOfProjects(0).ID) 'Get a list of the names/IDs of models in the current project. Dim ListOfModels() As NameIdPair ListOfModels = MyRepository.Model.GetAllModelsInfo() 'Retrieve the first model in the list. Dim AModel As cModel AModel = MyRepository.Model.GetModel(ListOfModels(0).ID) 'Calculate the reliability at time = 50 and save the result. See Reliability. Dim Rel As Double Rel = AModel.Reliability(50) 'Disconnect from the repository. MyRepository.DisconnectFromRepository()