1. Replacement

A replacement operation substitutes an existing model object with another object. This is useful when a model variation needs to swap out a component of the model for a different configuration.

  • Model: The existing model object to be replaced. Must be set.

  • Replacement: The new model object that will take its place. Must be set and must be of a compatible type.

When executed, a copy of the replacement object is created and used to replace the original. If both the original and the replacement are named objects, the copy inherits the name of the original object.

The replacement must be type-compatible with the containment feature of the original object. For example, you cannot replace a body with an environment since they occupy different roles in the model. An error is raised during validation or execution if the types are incompatible.