CModel.SetModel: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:




<onlyinclude>Sets the model type, category, name and parameters of an existing [[CModel Class|cModel]] object.</onlyinclude>
<onlyinclude>Sets the model type, category, name and parameters for a new [[CModel Class|cModel]] object. Can also be used to replace an existing model.</onlyinclude>


== Syntax ==
== Syntax ==
Line 26: Line 26:
  {{APIComment|...}}
  {{APIComment|...}}
   
   
  {{APIComment|'Add code to create a new model or get an existing model.}}
  {{APIComment|'Add code to create a new model or get an existing model you want to replace with a new model.}}
   {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
   {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
  {{APIComment|...}}
  {{APIComment|...}}
   
   
  {{APIComment|'Define or change the model's properties.}}
  {{APIComment|'Specify the definitions for the model.}}
   {{APIPrefix|Dim}} params(1) {{APIPrefix|As Double}}
   {{APIPrefix|Dim}} params(1) {{APIPrefix|As Double}}
   params(0) = 5
   params(0) = 5
   params(1) = 1
   params(1) = 1
 
{{APIComment|'Apply the definition to the model.}}
   {{APIPrefix|Call}} AModel.SetModel(ModelTypeEnum_Lognormal, ModelCategoryEnum_Reliability, {{APIString|"Model1"}}, params)
   {{APIPrefix|Call}} AModel.SetModel(ModelTypeEnum_Lognormal, ModelCategoryEnum_Reliability, {{APIString|"Model1"}}, params)


Line 40: Line 42:
  {{APIComment|...}}
  {{APIComment|...}}
   
   
  {{APIComment|'Add code to create a new model or get an existing model.}}
  {{APIComment|'Add code to create a new model or get an existing model you want to replace with a new model.}}
   {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
   {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
  {{APIComment|...}}
  {{APIComment|...}}
   
   
  {{APIComment|'Define or change the model's properties.}}
  {{APIComment|'Specify the definitions for the model. You can use an in-line parameter list to apply the update to the model.}}
   AModel.SetModel(ModelTypeEnum.Lognormal, ModelCategoryEnum.Reliability, {{APIString|"Model1"}}, {{APIPrefix|New Double}}() {1, 100} )
   AModel.SetModel(ModelTypeEnum.Lognormal, ModelCategoryEnum.Reliability, {{APIString|"Model1"}}, {{APIPrefix|New Double}}() {1, 100} )

Revision as of 21:40, 22 October 2015

APIWiki.png


Member of: SynthesisAPI9.cModel


Sets the model type, category, name and parameters for a new cModel object. Can also be used to replace an existing model.

Syntax

.SetModel(ModelType, ModelCategory, ModelName, ByRef ModelParams())

Parameters

ModelType

Required. The model type (e.g., 2-parameter Weibull). Can be any ModelTypeEnum constant.

ModelCategory

Required. The model category (e.g., reliability model). Can be any ModelCategoryEnum constant.

ModelName

Required. String. The model name.

ModelParams()

Required. Double. An array of the model's parameters.


Example

VBA

 ... 

 'Add code to create a new model or get an existing model you want to replace with a new model. 
 Dim AModel As New cModel
 ... 

 'Specify the definitions for the model. 
 Dim params(1) As Double
 params(0) = 5
 params(1) = 1
 
 'Apply the definition to the model. 
 Call AModel.SetModel(ModelTypeEnum_Lognormal, ModelCategoryEnum_Reliability, "Model1", params)
VB.NET

 ... 

 'Add code to create a new model or get an existing model you want to replace with a new model. 
 Dim AModel As New cModel
 ... 

 'Specify the definitions for the model. You can use an in-line parameter list to apply the update to the model. 
 AModel.SetModel(ModelTypeEnum.Lognormal, ModelCategoryEnum.Reliability, "Model1", New Double() {1, 100} )