The com.nomagic.magicdraw.core.Project represents the storage of all project specific data like the UML model, all diagrams, project specific options and etc.

Multiple projects can be opened at the same time, but just one Project can be active in UI. Data from one project can not reference data in other opened project. The active (current) project can be accessible in the following way:

   Project project = Application.getInstance().getProject();
Also, the Project is accessible for any other com.nomagic.magicdraw.uml.BaseElement (UML Element or Presentation Element)

 

    Project project = Project.getProject(element);

The project keeps references to a root Model(s), also has references to all diagrams.

Project always have one primary root Model and may have zero or more attached Models from used projects. Attached models are available only in projects loaded from the Cameo Enterprise Dataware server. Locally stored projects or projects have only a primary root model.

The primary root model can be accessed in the following way:

    Package model = project.getPrimaryModel();

 All root models can be accessed in the following way:

    List<Package> models = project.getModels();