Repository.Model.AddModel

Saves a new cModel object to the current project. Returns a Boolean value; when true, indicates a successful save.

If a model with the same name already exists in the current project, the application will automatically increment the name. For example, if "Model1" already exists, the new model might be renamed to "Model2," "Model3," etc.

Syntax
.Model.AddModel(m)

Parameters
m
 * The cModel object to be added. (Required)

Example
This example creates a new model resource, and then saves it in the first available project in a Synthesis repository. VBA MyRepository Repository 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)

VB.NET MyRepository Repository newModel cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability,, 1, 100) MyRepository.Project.SetCurrentProject(1) MyRepository.Model.AddModel(newModel)