Skip to main content

IProjectService Interface

Namespace: NextDesign.Core.Runtime

Description

Project service.
Provides project operations.

Method

NameDescription
CleanUpProjectCleans up the project.
CloseProjectCloses the specified project.

Call this method to close a project instance obtained with NewProject(string, string, string) or OpenProject(string, bool) when it is no longer needed, regardless of whether you saved it.
Failing to close the project will result in a memory leak.
GetModelUnitsGets a list of model units for the project.
LoadModelUnits(IProject,IEnumerable<IModelUnit>)Adds and loads the specified model units in the specified project. If the specified unit is already loaded, it will be ignored. Also, if the specified unit is not managed by the project, it will be ignored.

Note that calling this method will fail if the target project has not been saved.
LoadModelUnits(IProject,IEnumerable<string>)Adds and loads the specified model units in the specified project. If the specified unit is already loaded, it will be ignored. Also, if the specified unit is not managed by the project, it will be ignored.

Note that calling this method will fail if the target project has not been saved.
NewProjectCreates a new project.

A project created with this method should be closed using CloseProject(IProject) when it is no longer needed, regardless of whether it is saved or not.
Failing to close the project will result in a memory leak.
OpenProjectOpens the project at the specified path.

A project opened with this method should be closed using CloseProject(IProject) when it is no longer needed, regardless of whether it is saved or not.
Failing to close the project will result in a memory leak.
SaveProjectSaves the specified project.

Normally, this method throws an exception if the destination file for the project has been overwritten since the specified project was loaded.
However, if the argument: forceOverwrite is set to true, this check will not be performed and the project will be forcibly saved.
SaveProjectAsSaves the specified project under a different name. If the specified destination folder does not exist, it will be created automatically.
UpdateProjectOutputModelPathsUpdates the paths of referenced models in the specified project.

This is only valid if the save format of the specified project supports path output for referenced models.
An exception will be thrown if the save format has not been determined or if the save format does not support path output.
If the project has not been saved yet, changes to the project will be saved at the same time as the path is updated.
In addition, the paths of referenced models will only be updated for loaded and editable units managed by the specified project.