ParamValues Class: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
Line 7: Line 7:


== Usage Example ==
== Usage Example ==
  {{APIComment|'Declare a new repository connection class.}}
  {{APIComment|'Declare a new repository connection object.}}
   Dim MyRepository As New Repository
   Dim MyRepository As New Repository
    
    

Revision as of 22:18, 27 May 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 object. 
 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