MATLAB: How to query the bounding box coordinates of the Simulink model’s printout in Simulink 7.2 (R2008b)

boundingboundingboxboxcoordinatesemfmetafilemodelprintsimulinksystembounds

I would like to be able to map Simulink coordinates to metafile coordinates. The bounding box coordinates of blocks in the produced EMF file map well to the Simulink coordinates as long as there is not a lot of white space around the blocks in the model or a block is located in the upper left corner of the model. Also, it appears that the EMF file has a bounding box much tighter around the blocks. I would like to know how to query the bounding box coordinates in Simulink.

Best Answer

In order to obtain the bounding box coordinates of a Simulink model, one of the following features can be used:
1. Query the model property 'Systembounds':
get_param(gcs,'Systembounds')
2. Obtain the bounds using the SL_GET_GRAPH_VIEW_BOUNDS function:
sl_get_graph_view_bounds(get_param(gcs,'handle'))
Note that both features described here are undocumented, and may be subjected to change in future releases of MATLAB.