Create query to select all components in model
query = AnyComponent()
example
query = AnyComponent() creates a query object that the find method and the createViewArchitecture method use to select all components in the model.
query
find
createViewArchitecture
collapse all
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 to find all components and list the second.
constraint = AnyComponent(); components = find(m,constraint,'Recurse',true,'IncludeReferenceModels',true); components(2)
ans = 1×1 cell array {'KeylessEntryArchitecture/Door Lock//Unlock System/Door Lock Controller'}
Query, returned as a systemcomposer.query.Constraint object.
systemcomposer.query.Constraint
createViewArchitecture | find | systemcomposer.query.Constraint