Main Content

saveToDictionary

Save interfaces to dictionary

    Description

    saveToDictionary(model,dictionaryName) saves all locally defined interfaces to a shared dictionary, and links the model to the shared dictionary with a .sldd extension.

    example

    saveToDictionary(dictionary,dictionaryName) saves all locally defined interfaces to a shared dictionary with an SLDD extension.

    saveToDictionary(___,Name=Value) saves all locally defined interfaces to a shared dictionary with additional options.

    Examples

    collapse all

    Create a model and a shared dictionary. Add an interface to the model's interface dictionary, and add an element. Save all interfaces defined in the model to the shared dictionary.

    arch = systemcomposer.createModel("newModel");
    dictionary = systemcomposer.createDictionary("myInterfaces.sldd");
    interface = addInterface(arch.InterfaceDictionary,"newSignal");
    element = addElement(interface,"newElement",Type="double");
    saveToDictionary(arch,"myInterfaces")

    Input Arguments

    collapse all

    Architecture model, specified as a systemcomposer.arch.Model object.

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

    Dictionary name, specified as a character vector or string. If a dictionary with this name does not exist, one will be created.

    Example: "myInterfaces"

    Data Types: char | string

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

    Example: saveToDictionary(arch,"MyInterfaces",CollisionResolutionOption=systemcomposer.interface.CollisionResolution.USE_MODEL)

    Option to resolve interface collisions between the local model data dictionary and the shared data dictionary linked to the model, specified as one of these values:

    • systemcomposer.interface.CollisionResolution.USE_MODEL prioritizes interface duplicates using the local interfaces defined in the model.

    • systemcomposer.interface.CollisionResolution.USE_DICTIONARY prioritizes interface duplicates using the interfaces defined in the shared dictionary.

    Note

    If interface collisions are present and you do not specify a value for the CollisionResolutionOption name-value argument, the saveToDictionary function generates an error and prompts specification.

    Example: saveToDictionary(arch,"MyInterfaces",CollisionResolutionOption=systemcomposer.interface.CollisionResolution.USE_DICTIONARY)

    Data Types: enum

    More About

    collapse all

    Version History

    Introduced in R2019b

    See Also

    Functions

    Objects

    Blocks

    Tools