ParamValues Class: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
Line 14: Line 14:
   Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr9")
   Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr9")
    
    
  {{APIComment|'Get the list of projects in the connected repository.}}
  {{APIComment|'Get a list of the names/IDs of projects in the connected repository.}}
  Dim ListOfProjects() As NameIdPair
  ListOfProjects = MyRepository.GetAllProjects
 
{{APIComment|'Open the first project in the list.}}
  MyRepository.SetCurrentProject(ListOfProjects(0).ID)
 
{{APIComment|'Get a list of the names/IDs of models in the current project.}}
   Dim ListOfModels() As NameIdPair
   Dim ListOfModels() As NameIdPair
   ListOfModels = MyRepository.GetAllModelsInfo()
   ListOfModels = MyRepository.GetAllModelsInfo()
    
    
  {{APIComment|'Select the ID of the model and retrieve it.}}
  {{APIComment|'Retrieve the first model in the list.}}
   Dim AModel as cModel
   Dim AModel as cModel
   AModel = MyRepository.GetModel(ListOfModels(0).ID)
   AModel = MyRepository.GetModel(ListOfModels(0).ID)

Revision as of 00:11, 18 April 2014


Model's parameter name and value.

Properties

  • Value (as double) Gets the value of the parameter.
  • ParamName (as string) Gets the name of the parameter.

Usage Example

 'Declare a new repository connection class. 
 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.rsr9")
 
 'Get a list of the names/IDs of projects in the connected repository. 
 Dim ListOfProjects() As NameIdPair
 ListOfProjects = MyRepository.GetAllProjects 
 
 'Open the first project in the list. 
 MyRepository.SetCurrentProject(ListOfProjects(0).ID)
 
 'Get a list of the names/IDs of models in the current project. 
 Dim ListOfModels() As NameIdPair
 ListOfModels = MyRepository.GetAllModelsInfo()
 
 'Retrieve the first model in the list. 
 Dim AModel as cModel
 AModel = MyRepository.GetModel(ListOfModels(0).ID)
 
 'Get the list of model parameters. 
 Dim ModelParameters() As ParamValues
 ModelParameters = AModel.Parameters
 
 Get the name of the model's first parameter. 
 Dim ModelParamName as String
 ModelParamVame = ModelParameters(0).ParamName
 
 Get the value of the model's first parameter. 
 Dim ModelParamValue as Double
 ModelParamValue = ModelParameters(0).Value