Main Content

lookup

Search for architectural element

Description

element = lookup(object,Name=Value) finds an architectural element based on its universal unique identifier (UUID) or full path.

example

instance = lookup(object,Name=Value) finds an architectural element instance based on its universal unique identifier (UUID) or full path.

Note

This function is part of the instance programmatic interfaces that you can use to analyze the model iteratively, element-by-element. The instance refers to the element instance on which the iteration is being performed.

Examples

collapse all

This example shows how to find a component by path in a robot model.

arch = systemcomposer.loadModel("Robot");
component = lookup(arch,Path="Robot/Sensor")
component = 
  Component with properties:

     IsAdapterComponent: 0
           Architecture: [1×1 systemcomposer.arch.Architecture]
                   Name: 'Sensor'
                 Parent: [1×1 systemcomposer.arch.Architecture]
                  Ports: [1×2 systemcomposer.arch.ComponentPort]
             OwnedPorts: [1×2 systemcomposer.arch.ComponentPort]
      OwnedArchitecture: [1×1 systemcomposer.arch.Architecture]
             Parameters: [0×0 systemcomposer.arch.Parameter]
               Position: [349 74 469 174]
                  Model: [1×1 systemcomposer.arch.Model]
         SimulinkHandle: 167.0029
    SimulinkModelHandle: 153.0013
                   UUID: 'cfd62628-d365-47e4-8492-62cfeaa8dc15'
            ExternalUID: ''

Input Arguments

collapse all

Architecture model or instance object to look up, specified as a systemcomposer.arch.Model or systemcomposer.analysis.ArchitectureInstance object.

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: lookup(arch,Path="Robot/Sensor")

UUID to use for search, specified as a character vector or string of the UUID.

Example: lookup(arch,UUID="f43c9d51-9dc6-43fc-b3af-95d458b81248")

Data Types: char | string

Simulink handle to use for search, specified as the SimulinkHandle value.

Example: lookup(arch,SimulinkHandle=9.0002)

Data Types: double

Full path, specified as a character vector or string.

Example: lookup(arch,Path="Robot/Sensor")

Data Types: char | string

Output Arguments

collapse all

More About

collapse all

Version History

Introduced in R2019a