Main Content

addReference

Add reference to dictionary

Since R2021a

    Description

    addReference(dictionary,reference,collisionResolutionOption) adds a referenced dictionary to a dictionary in a System Composer™ model.

    example

    Examples

    collapse all

    Add a data interface named newInterface to the local dictionary of the model. Save the local dictionary to a shared dictionary as an SLDD file.

    arch = systemcomposer.createModel("newModel");
    systemcomposer.openModel("newModel");
    addInterface(arch.InterfaceDictionary,"newInterface");
    saveToDictionary(arch,"TopDictionary")
    topDictionary = systemcomposer.openDictionary("TopDictionary.sldd");

    Create a new dictionary and add it as a reference to the existing dictionary.

    refDictionary = systemcomposer.createDictionary("ReferenceDictionary.sldd");
    addReference(topDictionary,"ReferenceDictionary.sldd")

    Confirm in the Model Explorer.

    Input Arguments

    collapse all

    Data dictionary, specified as a systemcomposer.interface.Dictionary object. For information on how to create a data dictionary, see createDictionary.

    Referenced dictionary, specified as a character vector or string of the name of the referenced dictionary with the .sldd extension.

    Example: "ReferenceDictionary.sldd"

    Data Types: char | string

    Collision resolution option if there is a conflict between two interfaces with the same name in the dictionaries, specified as one of the following:

    • "KeepTop" to keep the interface from the top dictionary and remove the one in the reference dictionary.

    • "KeepReference" to keep the interface from the reference dictionary and remove the one in the top dictionary.

    • "Unspecified", which will error if any conflicts exist when creating the reference.

    Data Types: char | string

    More About

    collapse all

    Version History

    Introduced in R2021a

    See Also

    Functions

    Objects

    Blocks

    Tools