主要内容

本页采用了机器翻译。点击此处可查看英文原文。

getReferencedDictionaries

获取引用字典

自 R2026a 起

说明

dicts = getReferencedDictionaries(dictionary) 获取由指定字典引用的字典。

dicts = getReferencedDictionaries(dictionary,recurse) 可获取引用字典,并支持递归查找引用中的引用。

示例

示例

全部折叠

在模型的本地字典中添加名为 newInterface 的数据接口。将本地字典作为 SLDD 文件保存到共享字典中。

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

创建新字典,并将其添加为现有字典的引用。

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

创建第二个字典,并将其作为引用添加到被引用的字典中。

newDictionary = systemcomposer.createDictionary("NewDictionary.sldd");
addReference(refDictionary,"NewDictionary.sldd")

获取 TopDictionary.sldd 字典的字典引用,其中 recurse 被设置为 true

dicts = getReferencedDictionaries(topDictionary,true)
dicts = 

  1×2 Dictionary array with properties:

    Interfaces
    Profiles
    UUID
    ExternalUID

输入参数

全部折叠

数据字典,指定为 systemcomposer.interface.Dictionary 对象。有关如何创建数据字典的信息,请参阅 createDictionary

是否进行递归,指定为 1 (true) 或 0 (false)。

数据类型: logical

输出参量

全部折叠

数据字典,以 systemcomposer.interface.Dictionary 对象或 systemcomposer.interface.Dictionary 对象数组的形式返回。

详细信息

全部折叠

版本历史记录

在 R2026a 中推出

另请参阅

函数

对象

模块

工具