Projects management

The com.nomagic.magicdraw.core.project.ProjectsManager class is responsible for containment and management of projects.

Use the code below to access ProjectsManager

ProjectsManager projectsManager = Application.getInstance().getProjectsManager();

images/download/attachments/47117700/ProjectsManager.png
ProjectsManager provides the API for com.nomagic.magicdraw.core.Project creating, closing, saving, loading, and activating. A program can have multiple opened projects, but only one project can be active.

//Gets all the projects
List<Project> projects = projectsManager.getProjects();
//Gets an active project
Project activeProject = projectsManager.getActiveProject();

An active project can also be accessed directly from com.nomagic.magicdraw.core.Application:

//Gets an active project
Project project = Application.getInstance().getProject();

You can find the code examples in <programinstallation directory>\openapi\examples\projects