Main Content

HasStereotype

Create query to select architecture elements with stereotype based on specified sub-constraint

Description

example

query = HasStereotype(sub-constraint) creates a query object that the find method and the createViewArchitecture method use to select architecture elements with a stereotype that satisfies the given sub-constraint.

Examples

collapse all

Select all of the hardware components in an architecture model.

Import the package that contains all of the System Composer™ queries.

import systemcomposer.query.*;

Open the Simulink® project file.

scKeylessEntrySystem

Open the model.

m = systemcomposer.openModel('KeylessEntryArchitecture');

Create a query for all the hardware components and run the query, displaying one of them.

constraint = HasStereotype(IsStereotypeDerivedFrom('AutoProfile.HardwareComponent'));
hwComp = find(m,constraint,'Recurse',true,'IncludeReferenceModels',true);
hwComp(16)
ans =

  1×1 cell array

    {'KeylessEntryArchitecture/FOB Locator System/Center Receiver/PWM'}

Input Arguments

collapse all

Condition restricting the query, specified as a systemcomposer.query.Constraint object.

Example: IsStereotypeDerivedFrom('AutoProfile.HardwareComponent')

Output Arguments

collapse all

Query, returned as a systemcomposer.query.Constraint object.

Introduced in R2019b