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 will be this instance.
Note that no exception will be thrown even if the upper multiplicity constraint of the destination field is violated.

Arguments

NameTypeDescription
fieldNamestringField name
Null or an empty string cannot be specified.
targetIModelModel to be moved
Null cannot be specified.
directionstringDirection of addition at destination
- "first" : Beginning
- "last" : End
- "before" : Before
- "after" : After
indexintReference position for addition
Specify an index with the first position being 0.
If "direction" is specified as "first", it will move to the beginning regardless of the index value.
If "direction" is specified as "last", it will move to the end regardless of the index value.
If "before" is specified as "direction", the instance will move to the specified position, and if "after", it will move to the position next to the specified position.

Return value

  • void

Exception

NameException classDescription
Invalid argumentExtensionArgumentExceptionIf null is specified for target
If null or an empty string is specified for fieldName
If a string other than the default string is specified for direction
Field not foundExtensionFieldNotFoundExceptionIf the specified field is not found in the metaclass of this instance
Invalid index rangeExtensionOutOfRangeExceptionIf a negative number is specified for index
Or, index is specified as a value greater than the number of elements in the field.
Invalid specified fieldExtensionInvalidTypeExceptionThe specified field is not an owned field, or the data type of the specified field is not compatible with the metaclass of the instance to be moved.
Invalid operationExtensionInvalidOperationExceptionIf the model itself is a deleted model or a temporary proxy.
If an inoperable field is specified for the field name.
- Feature assignment field of a product line
- Field with the System.Core tag
If an invalid field is specified.
Circular referenceExtensionCircularReferenceExceptionIf the target for which this method is called or its ancestor is specified for target.
An invalid model is specified.ExtensionInvalidModelExceptionIf the following models are specified for the model to be moved.
- Deleted model
- Temporary proxy
- Project
- Model that is the base point in the unit and whose parent element has not been loaded.