Skip to main content

IModel.Take method

Namespace: NextDesign.Core

Description

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

argument

NameTypeDescription
fieldNamestringField name
Null or an empty string cannot be specified.
targetIModelModel to move
Null cannot be specified.
directionstringAddition direction at the destination
-"first": First
-"last": Last
-"before": Before
-"after": After
indexintAdditional reference position
Specify the index with the start position as 0.
If the direction is specified as "first", it will move to the beginning regardless of the index value.
If the direction is specified as "last", it will be moved to the end regardless of the index value.
If the direction specification is "before", the instance is moved to the specified position, and if it is "after", the instance is moved to the position next to the specified position.

Return value

  • void

Exception

NameException ClassDescription
Invalid argumentExtensionArgumentExceptionWhen null is specified for target
When null or an empty string is specified for fieldName
When a character string other than the default character string is specified for direction
Field not foundExtensionFieldNotFoundExceptionIf the specified field is not found in the metaclass of this instance
Invalid index rangeExtensionOutOfRangeExceptionWhen a negative number is specified for index
or when a value greater than or equal to the number of elements in the corresponding field is specified for index
Specified field invalidExtensionInvalidTypeExceptionIf the specified field is not a owned field or the data type of the specified field is incompatible with the metaclass of the instance to which it is moved
Illegal operationExtensionInvalidOperationExceptionIf it is a deleted model or a temporary proxy
If an inoperable field is specified in the field name
-Product line feature assignment field
-System Fields with .Core tags
Circular referenceExtensionCircularReferenceExceptionWhen target is the call target of this method or its ancestors
Invalid model specifiedExtensionInvalidModelExceptionWhen the following model is specified as the moving model
-Deleted model
-Temporary proxy
-Project
-Unit A model that is the starting point in and has no parent element loaded