CModel.Parameters: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 19: Line 19:
  {{APIComment|'Get a list of the model's parameters.}}
  {{APIComment|'Get a list of the model's parameters.}}
   {{APIPrefix|Dim}} ModelParameters() {{APIPrefix|As}} ParamValues
   {{APIPrefix|Dim}} ModelParameters() {{APIPrefix|As}} ParamValues
   ModelParameters = AModel.Parameters
   ModelParameters = AModel.Parameters()
{{APIComment|'Output example: Display the name and value of the first parameter.}}
  Dim ParamName {{APIPrefix|As}} String
  Dim ParamValue {{APIPrefix|As}} Double
  ParamName = ModelParameters(0).ParamName
  ParamValue = ModelParameters(0).Value
  MsgBox (ParamName & " = " & ParamValue)

Revision as of 22:31, 28 July 2015

APIWiki.png


Member of: SynthesisAPI9.cModel


Returns a ParamValues object array, which contains the names and values of a model's parameters.

Syntax

.Parameters()


Example

VBA|VB.NET

 ... 

 'Add code to get an existing model or create a new one. 
 Dim AModel As New cModel
 ... 

 'Get a list of the model's parameters. 
 Dim ModelParameters() As ParamValues
 ModelParameters = AModel.Parameters()

 'Output example: Display the name and value of the first parameter. 
 Dim ParamName As String
 Dim ParamValue As Double
 ParamName = ModelParameters(0).ParamName
 ParamValue = ModelParameters(0).Value
 MsgBox (ParamName & " = " & ParamValue)