ParamValues Class: Difference between revisions
Jump to navigation
Jump to search
Chris Kahn (talk | contribs) |
Chris Kahn (talk | contribs) |
||
Line 7: | Line 7: | ||
== Usage Example == | == Usage Example == | ||
In this example, a model is accessed from a repository, and the name/value of the model's first parameter are retrieved. | |||
{{APIComment|'Declare a new repository connection object.}} | {{APIComment|'Declare a new repository connection object.}} | ||
Dim MyRepository As New Repository | Dim MyRepository As New Repository | ||
Line 16: | Line 17: | ||
{{APIComment|'Get a list of the names/IDs of projects in the connected repository.}} | {{APIComment|'Get a list of the names/IDs of projects in the connected repository.}} | ||
Dim ListOfProjects() As NameIdPair | Dim ListOfProjects() As NameIdPair | ||
ListOfProjects = MyRepository.GetAllProjects | ListOfProjects = MyRepository.GetAllProjects() | ||
{{APIComment|'Open the first project in the list.}} | {{APIComment|'Open the first project in the list.}} | ||
Line 40: | Line 41: | ||
Dim ModelParamValue as Double | Dim ModelParamValue as Double | ||
ModelParamValue = ModelParameters(0).Value | ModelParamValue = ModelParameters(0).Value | ||
{{APIComment|Disconnect from the repository.}} | |||
MyRepository.DisconnectFromRepository() |
Revision as of 22:20, 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
In this example, a model is accessed from a repository, and the name/value of the model's first parameter are retrieved.
'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 Disconnect from the repository. MyRepository.DisconnectFromRepository()