Main Content

HasStereotype

Create query to select architectural elements with stereotype based on specified subconstraint

Description

query = HasStereotype(subconstraint) creates a query query that the find and createView functions use to select architectural elements with a stereotype that satisfies the given subconstraint subconstraint.

example

Examples

collapse all

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

import systemcomposer.query.*

Open the Simulink® project file for the keyless entry system.

openProject("scKeylessEntrySystem");

Load the architecture model.

model = systemcomposer.loadModel("KeylessEntryArchitecture");

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

constraint = HasStereotype(IsStereotypeDerivedFrom("AutoProfile.HardwareComponent"));
hwComp = find(model,constraint,Recurse=true,IncludeReferenceModels=true);
comp = hwComp(16)
comp = 1×1 cell array
    {'KeylessEntryArchitecture/FOB Locater System/Center Receiver/Antenna'}

Input Arguments

collapse all

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

Output Arguments

collapse all

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

More About

collapse all

Version History

Introduced in R2019b