Skip to main content

IModel.Take method

Namespace: NextDesign.Core

Description

Moves the specified model to the specified field of this instance.
This instance is the parent element of the model to be moved.
Note that no exception is thrown even if the upper multiplicity constraint of the destination field is violated.

argument

NameTypeDescription
fieldNamestringField name
You cannot specify null or an empty string.
targetIModelModel to move
Cannot be null.
directionstringAdditional direction at destination
- "first" : beginning
- "last" : end
- "before" : before
- "after" : after
indexintAdditional reference position
Specifies the index with 0 as the starting position.
If the direction specification is "first", it moves to the beginning regardless of the index value.
If the specified direction is "last", it moves to the end regardless of the index value.
If the direction is "before", move the instance to the specified position, and if it is "after", move the instance to the next position after the specified position.

Return value

  • void

Exceptions

NameException ClassDescription
Invalid argumentExtensionArgumentExceptionWhen null is specified for target
When null or an empty string is specified for fieldName
When a string other than the default string is specified for direction
Field not foundExtensionFieldNotFoundExceptionIf the specified field is not found in this instance's metaclass
Invalid index rangeExtensionOutOfRangeExceptionWhen a negative number is specified for index
or when a value greater than the number of elements in the corresponding field is specified for index
Specified field is invalidExtensionInvalidTypeExceptionIf the specified field is not the owning field or if the data type of the specified field is incompatible with the metaclass of the instance to be moved
Illegal operationExtensionInvalidOperationExceptionIf the model itself has been deleted or is a temporary proxy
If an inoperable field is specified in the field name
- Product line feature assignment field
- System Fields tagged with .Core
Circular referenceExtensionCircularReferenceExceptionIf target specifies itself or an ancestor of this method call
Specifying an invalid modelExtensionInvalidModelExceptionIf the following model is specified for the model to be moved
- Deleted model
- Temporary proxy
- Project
- Unit A model that is the base point in and whose parent element has not been loaded