API Reference > imodeljs-common > DisplayStyles > ContextRealityModels > replace replace Method Replace a reality model in the list. replace(toReplace: ContextRealityModel, replaceWith: ContextRealityModelProps): ContextRealityModel throws Error if toReplace is not present in the list note The replacement occupies the same index in the list as toReplace did. Parameter Type Description toReplace ContextRealityModel The reality model to be replaced. replaceWith ContextRealityModelProps The JSON representation of the replacement reality model. Returns - ContextRealityModel the newly-created reality model that replaced toReplace. Defined in core/common/src/ContextRealityModel.ts Line 367 Last Updated: 11 June, 2024