Repository.Model.AddModel

Adds a new model to a project. Returns a Boolean value; when true, indicates a successful save.

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

Syntax
.Model.AddModel(m)

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

Example
This example creates a new model resource, and then saves it in the first available project in a Synthesis repository. VBA MyRepository Repository MyRepository.ConnectToAccessRepository 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 MyRepository.ConnectToAccessRepository newModel cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability,, 1, 100) MyRepository.Project.SetCurrentProject(1) MyRepository.Model.AddModel(newModel)