主要内容

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

current

获取当前所选元素的对象

    说明

    obj = systemcomposer.arch.current 返回当前所选元素的对象。该元件可以是组件、端口或连接器。当未选中任何元素时,此函数的默认值为 systemcomposer.arch.Architecture.current

    示例

    arch = systemcomposer.arch.Architecture.current 返回当前架构的对象。

    示例

    model = systemcomposer.arch.Model.current 返回当前模型的对象。

    comp = systemcomposer.arch.Component.current 返回当前组件的对象。

    adapter = systemcomposer.arch.Adapter.current 返回当前适配器的对象。

    varComp = systemcomposer.arch.VariantComponent.current 返回当前变体组件的对象。

    archPort = systemcomposer.arch.ArchitecturePort.current 返回当前架构端口的对象。

    compPort = systemcomposer.arch.ComponentPort.current 返回当前组件端口的对象。

    conn = systemcomposer.arch.Connector.current 返回当前连接器的对象。

    physConn = systemcomposer.arch.PhysicalConnector.current 返回当前物理连接器的对象。

    示例

    全部折叠

    从画布中获取当前选中的元素(此处指组件)。

    systemcomposer.arch.current
    
    ans = 
    
      Component with properties:
    
         IsAdapterComponent: 0
               Architecture: [1×1 systemcomposer.arch.Architecture]
                       Name: 'Component'
                     Parent: [1×1 systemcomposer.arch.Architecture]
                      Ports: [0×0 systemcomposer.arch.ComponentPort]
                 OwnedPorts: [0×0 systemcomposer.arch.ComponentPort]
          OwnedArchitecture: [1×1 systemcomposer.arch.Architecture]
                 Parameters: [0×0 systemcomposer.arch.Parameter]
                   Position: [172 91 292 191]
                      Model: [1×1 systemcomposer.arch.Model]
             SimulinkHandle: 151.0001
        SimulinkModelHandle: 149.0002
                       UUID: 'c824f870-49d5-4e24-86e7-20c31ed5ef7a'
                ExternalUID: ''

    从画布中获取当前的根架构。

    systemcomposer.arch.Architecture.current
    
    ans = 
    
      Architecture with properties:
    
                       Name: 'untitled'
                 Definition: Composition
                     Parent: [0×0 systemcomposer.arch.Component]
                 Components: [1×1 systemcomposer.arch.Component]
                      Ports: [0×0 systemcomposer.arch.ArchitecturePort]
                 Connectors: [0×0 systemcomposer.arch.Connector]
                 Parameters: [0×0 systemcomposer.arch.Parameter]
                      Model: [1×1 systemcomposer.arch.Model]
             SimulinkHandle: 149.0002
        SimulinkModelHandle: 149.0002
                       UUID: '01c42727-9848-4548-84e7-181e71a3c68d'
                ExternalUID: ''

    输出参量

    全部折叠

    架构,指定为 systemcomposer.arch.Architecture 对象。

    架构模型,指定为 systemcomposer.arch.Model 对象。

    组件,指定为 systemcomposer.arch.Component 对象。

    适配器,指定为 systemcomposer.arch.Adapter 对象。

    组件,指定为 systemcomposer.arch.VariantComponent 对象。

    架构端口,指定为 systemcomposer.arch.ArchitecturePort 对象。

    组件端口,指定为 systemcomposer.arch.ComponentPort 对象。

    连接器,以 systemcomposer.arch.Connector 对象形式返回。

    物理连接器,以 systemcomposer.arch.PhysicalConnector 对象形式返回。

    详细信息

    全部折叠

    版本历史记录

    在 R2019a 中推出