Skip to main content

IModelDuplicateService.Duplicate Method

Namespace: NextDesign.Core.Runtime

Description

Duplicates the specified model in the specified project.
The duplicated model is placed as a sibling of the specified model.
Duplicating applies to all child elements of the specified model, as well as relationships between those models and reference relationships that refer to the duplicated model.

Argument

NameTypeDescription
projectIProjectProject
modelIModelModel to duplicate
duplicateNamestringName of the duplicated model (optional)
If omitted, "${Model name to duplicate} - Duplicate" will be used.

Return value

Exceptions

NameException ClassDescription
Invalid ArgumentExtensionArgumentExceptionWhen project is specified as null
When model is specified as null
Invalid OperationExtensionInvalidOperationExceptionWhen a closed project is specified as project
When the duplication process cannot be performed
Example: When the parent model of the duplicated model is read-only
When the model to be duplicated is an interaction element model
Not SupportedExtensionNotSupportedExceptionWhen the current edition of the application is not supported