changeElementModel Method @beta

Change the model of a root element, making it a root element in the new model.

The element must not have a parent. The element's entire subtree moves with it: BIS requires a parent and all of its children to reside in the same model, so every descendant of the element is relocated into the target model as well. The parent-child hierarchy is preserved. The whole subtree is validated before anything is moved, so a rejected change leaves the iModel untouched.

Blocked cases (will throw):

  • Element has a parent (only root elements can be moved between models).
  • Any element in the subtree has a Model-scoped code (code uniqueness is tied to the source model; use delete+insert instead).
  • The moved (root) element has a ParentElement-scoped code (use delete+insert instead). A descendant's ParentElement-scoped code is allowed, because its parent moves with it.

Allowed cases (for any element in the subtree):

  • A Repository-scoped code (unique across entire iModel — unaffected by the model change).
  • A RelatedElement-scoped code (scope element is independent of the model).
  • No meaningful code (empty code).

The source and target models must be of the same class (classFullName must match exactly). Channel verification is performed on both the source and target models. Lock enforcement: requires an exclusive lock on every element in the moved subtree, and a shared lock on the target model.

changeElementModel(props: ChangeElementModelProps): void

@throws EditTxnError if this EditTxn is not active.

@throws ITwinError if the operation fails.

Parameter Type Description
props ChangeElementModelProps The model change parameters: element id and target model id.

Returns - void

Defined in

Last Updated: 04 July, 2026