Documentation

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, orgcsto 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

attachConfigSetCopycopies 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 argumentallowRenamedetermines how Simulink software handles a name conflict between configuration objects. IfallowRenameisfalseand the configuration object specified byconfigObjhas the same name as a configuration object already attached tomodel, Simulink software generates an error. IfallowRenameistrueand a name conflict occurs, Simulink software provides a unique name for the copy ofconfigObjbefore 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);

Introduced in R2006b

Was this topic helpful?