Cycle through components according to stereotype
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Loic
am 12 Jun. 2023
Bearbeitet: Josh Kahn
am 13 Jun. 2023
Hello,
I am investigating System Composer scripting, and I am looking for a way to cycle through every component that verifies the condition :
( Component.getStereotype(SoughtAfterStereotype) = true)
To then modify a property of said stereotype.
At this point I am investigating the forums and documentation, but couldn't find a way to cycle through every component of a model, to then check the condition.
Thank you very much in advance for your help !
0 Kommentare
Akzeptierte Antwort
Josh Kahn
am 13 Jun. 2023
Bearbeitet: Josh Kahn
am 13 Jun. 2023
System Composer has a query feature that is optimized for these kinds of search tasks. The API list for the query language can be found at the link below:
and more specific to your task, the PropertyValue constraint:
Here is something to get you started:
mdl = systemcomposer.loadModel('MyArchitecture')
[~, components] = find(mdl, systemcomposer.query.PropertyValue("Profile.Stereotype.Property1")==true)
arrayfun(@(component) setProperty(component, 'Profile.Stereotype.Property1', 'false'), components)
Please reach out if you have any other questions.
Regards,
Josh
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu System Composer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!