CModel.SetModel

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, 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 ModelType ModelTypeEnum ModelCategory ModelCategoryEnum ModelName ModelParams(2) ModelType = ModelTypeEnum_Weibull2 ModelCategory = ModelCategoryEnum_Reliability ModelName = ModelParams(0) = 1 ModelParams(1) = 100 newModel cModel newModel.SetModel(ModelType, ModelCategory, ModelName, ModelParams) MyRepository.Project.SetCurrentProject(1) MyRepository.Model.AddModel(newModel) AModel cModel AModel = MyRepository.Model.GetModel(47) AModel.SetModel(ModelType, ModelCategory, ModelName, ModelParams) MyRepository.Model.UpdateModel(AModel)

VB.NET ModelParams(1) ModelParams(0) = 1 ModelParams(1) = 100 newModel cModel(ModelTypeEnum.Weibull2,ModelCategoryEnum.Reliability,, ModelParams) MyRepository.Project.SetCurrentProject(1) MyRepository.Model.AddModel(newModel) AModel cModel AModel = MyRepository.Model.GetModel(47) AModel.SetModel(ModelTypeEnum.Weibull2,ModelCategoryEnum.Reliability,, ModelParams) MyRepository.Model.UpdateModel(AModel)