Filter löschen
Filter löschen

Print a Simulink Area Annotation Programmatically

2 Ansichten (letzte 30 Tage)
Franco Ruiz
Franco Ruiz am 25 Aug. 2022
Beantwortet: Ayush am 1 Dez. 2023
I want to be able to programmatically print by area and subsequently print all logic within that area in a Simulink Model.
I have 3 areas stacked on top of one another in a model but I want to separately print them to 3 different .pdfs or one .pdf but on 3 separate pages.
I understand that Areas are a type of annotation and one solution I thought of was to locate each area_annotation (I currently can find the 4 corners of the area in pixels w.r.t the origin of the page), and after I have the location of the areas then tile print or slice the image based on those positions. I toyed around with the report generator in Simulink but I think the options are limited in terms of dissecting at this granularity.
Any help is appreciated, thank you.

Antworten (1)

Ayush
Ayush am 1 Dez. 2023
Hi Franco,
I understand that you want to print an area_annotation programmatically. Additionally, the areas are stacked on top of one another and would have to be printed separately.
Such a use case is not yet supported by MATLAB where one can programmatically print an area_annotation. But the approach mentioned by you can be extended where you can print a portion of the Simulink diagram using the tile print option. Its limitation is that you would not be able to stack the area_annotations of top one another and would have to separate it out into different tiles as set by you to print the annotations out into different pages. Please refer to the below documentation link to know more about how to print a part of a Simulink diagram:
Additionally to use the Simulink Report Generator, you can convert the respective area annotation into a subsystem and then use the "slreportgen.report.Diagram" class from the ReportAPI to print that specific subsystem. Please refer to the screenshot attached to know how to convert an area annotation to a subsystem:
Please refer to the below documentation to know more about the "slreportgen.report.Diagram" class:
Hope it helps,
Regards,
Ayush Misra

Kategorien

Mehr zu Subsystems finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by