Repository.Model.GetModel

Gets the model with the designated ID number and returns it as a cModel object. Returns nothing if the model does not exist or is not in the current project.

Syntax
object.Model.GetModel(ID)

where object is a variable that represents a Repository object.

Example
These examples assume that a model with ID# 47 exists in the repository.

VBA MyRepository Repository AModel cModel MyRepository.Project.SetCurrentProject(1) AModel = MyRepository.Model.GetModel(47) ModelName String ModelID Integer ModelName = AModel.Name ModelID = AModel.ID MsgBox ( & ModelName &  & ModelID)

VB.NET MyRepository Repository AModel cModel MyRepository.Project.SetCurrentProject(1) AModel = MyRepository.Model.GetModel(47) ModelName String ModelID Integer ModelName = AModel.Name ModelID = AModel.ID MsgBox ( & ModelName &  & ModelID)