Quantcast

Documentation Center

  • Trial Software
  • Product Updates

attachConfigSetCopy

Copy configuration set or configuration reference and associate it with model

Syntax

myConfigObj = attachConfigSetCopy(model, configObj)
myConfigObj = attachConfigSetCopy(model, configObj, allowRename)

Arguments

model

The name of an open model, or gcs to specify the current model

configObj

A configuration set (Simulink.ConfigSet) or configuration reference (Simulink.ConfigSetRef)

allowRename

Boolean that specifies how Simulink® software handles a name conflict

Description

attachConfigSetCopy copies the configuration set or configuration reference (configuration object) specified by configObj and associates the copy with model. Simulink software returns the copied configuration object as newConfigObj.

You cannot attach a configuration object to a model if the configuration object has the same name as another configuration object attached to the same model. The optional Boolean argument allowRename determines how Simulink software handles a name conflict between configuration objects. If allowRename is false and the configuration object specified by configObj has the same name as a configuration object already attached to model, Simulink software generates an error. If allowRename is true and a name conflict occurs, Simulink software provides a unique name for the copy of configObj before associating it with model.

Examples

The following example creates a copy of ModelA's active configuration object and attaches it to ModelB, changing the name if necessary to be unique. The code is the same whether the object is a configuration set or configuration reference.

myConfigObj = getActiveConfigSet('ModelA');
newConfigObj = attachConfigSetCopy('ModelB', myConfigObj, true);

See Also

| | | | | | |

Was this topic helpful?