changeElementParent Method @beta

Change the parent of an element within its model.

The new parent must be in the same model as the element. Cross-model reparenting is not allowed; use changeElementModel only to move root elements between models. Only the target element is reparented — its children and their model membership are unaffected.

Blocked cases (will throw):

  • The new parent is in a different model than the element.
  • Element has a ParentElement-scoped code (code uniqueness is tied to the parent; use delete+insert instead).

Allowed cases:

  • Element has a Repository-scoped code (unique across entire iModel — unaffected by the parent change).
  • Element has a RelatedElement-scoped code (scope element is independent of the parent).
  • Element has a Model-scoped code (the model does not change, so the code remains valid).
  • Element has no meaningful code (empty code).

Channel verification is performed on the element's model. Lock enforcement: requires an exclusive lock on the element, and a shared lock on the new parent.

changeElementParent(props: ChangeElementParentProps): void

@throws EditTxnError if this EditTxn is not active.

@throws ITwinError if the operation fails.

Parameter Type Description
props ChangeElementParentProps The reparent parameters: element id and new parent id.

Returns - void

Defined in

Last Updated: 03 July, 2026