updateElement Method

Deprecated  Use EditTxn.updateElement instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.

Update some properties of an existing element. All parts of elProps are optional other than id. If id is missing, an exception is thrown.

To support clearing a property value, every property name that is present in the elProps object will be updated even if the value is undefined. To keep an individual element property unchanged, it should either be excluded from the elProps parameter or set to its current value.

updateElement<T extends ElementProps>(elProps: Partial<T>): void

@note The values of classFullName and model may not be changed by this method. Further, it will permute the elProps object by adding or overwriting their values to the correct values.

@throws ITwinError if update fails.

Parameter Type Description
elProps Partial<T> the properties of the element to update.

Returns - void

Defined in

Last Updated: 28 April, 2026