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 byconfigObj
和同事的副本model
. Simulink software returns the copied configuration object asnewConfigObj
.
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 argumentallowRename
determines how Simulink software handles a name conflict between configuration objects. IfallowRename
isfalse
and the configuration object specified byconfigObj
has the same name as a configuration object already attached tomodel
, Simulink software generates an error. IfallowRename
istrue
and a name conflict occurs, Simulink software provides a unique name for the copy ofconfigObj
before associating it withmodel
.
Examples
The following example creates a copy ofModelA
's active configuration object and attaches it toModelB
, 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
attachConfigSet
|closeDialog
|detachConfigSet
|getActiveConfigSet
|getConfigSet
|getConfigSets
|openDialog
|setActiveConfigSet