Contenido principal

current

Get object of currently selected element

    Description

    obj = systemcomposer.arch.current returns the object of the currently selected element. The element can be a component, port, or connector. When no element is selected, this function defaults to systemcomposer.arch.Architecture.current.

    example

    arch = systemcomposer.arch.Architecture.current returns the object of the current architecture.

    example

    model = systemcomposer.arch.Model.current returns the object of the current model.

    comp = systemcomposer.arch.Component.current returns the object of the current component.

    adapter = systemcomposer.arch.Adapter.current returns the object of the current adapter.

    varComp = systemcomposer.arch.VariantComponent.current returns the object of the current variant component.

    archPort = systemcomposer.arch.ArchitecturePort.current returns the object of the current architecture port.

    compPort = systemcomposer.arch.ComponentPort.current returns the object of the current component port.

    conn = systemcomposer.arch.Connector.current returns the object of the current connector.

    physConn = systemcomposer.arch.PhysicalConnector.current returns the object of the current physical connector.

    Examples

    collapse all

    Get the currently selected element which is a component in this case, from the canvas.

    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: ''

    Get the current root architecture from the canvas.

    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: ''

    Output Arguments

    collapse all

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

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

    Component, specified as a systemcomposer.arch.Component object.

    Adapter, specified as a systemcomposer.arch.Adapter object.

    Component, specified as a systemcomposer.arch.VariantComponent object.

    Architecture port, specified as a systemcomposer.arch.ArchitecturePort object.

    Component port, specified as a systemcomposer.arch.ComponentPort object.

    Connector, returned as a systemcomposer.arch.Connector object.

    Physical connector, returned as a systemcomposer.arch.PhysicalConnector object.

    More About

    collapse all

    Version History

    Introduced in R2019a