Access model viewmarks and notes programmatically
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like to access all of a model's viewmarks and notes in an automatic fashion.
For this I would need two pointers:
- How to get a list of all viewmarks+notes associated to a model. (find_system seems not to output them)
- A list of the parameters of viewmarks (name, associated subsystem, coordinates ...?) and notes (note texts ...) so as to access their content.
If you can only help with one of the two, it would still help :)
0 commentaires
Réponses (1)
Satwik
le 17 Fév 2025
I believe that viewmarks and notes in Simulink are part of the model annotations. The 'get_param' function along with the 'find_system' function can be used to access the annotation details from the model.
Here is a possible approach to achieve this:
% Load the model
load_system('your_model_name');
% Get all annotations in the model
annotations = find_system('your_model_name', 'FindAll', 'on', 'Type', 'annotation');
% Iterate over annotations to get details
for i = 1:length(annotations)
annotation = annotations(i);
text = get_param(annotation, 'Text');
position = get_param(annotation, 'Position');
% Display or process the annotation details
fprintf('Annotation %d: %s at position [%d, %d]\n', i, text, position(1), position(2));
end
I hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!