Add a model directly under a project
To add a model directly under a project, call the AddNewRootModel
method of the IProject
object.
public void AddRootModel(ICommandContext c, ICommandParams p)
{
//Create a model of the metaclass "UseCaseModel" in the project
IProject project = c.App.Workspace.CurrentProject;
IModel ucModel = project.AddNewRootModel("UseCaseModel");
//...
}