![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1557614/image.png)
Print a Simulink Area Annotation Programmatically
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Ayush
2023-12-1
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1557614/image.png)
Please refer to the below documentation to know more about the "slreportgen.report.Diagram" class:
Hope it helps,
Regards,
Ayush Misra
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!