'PaperPosition' property outputs different value when adding blocks into the Simulink model.

When obtaining the PaperPosition for the model, the values returned are clearly incorrect (wrong proportion). This field is necessary for the function that generates the screenshot of the model to a PDF file, resulting in unnecessary margins in the file. Current proportion: 
get_param('model_wrong_proportions','PaperPosition') ans = 9.2162    5.2044   11.2451   10.5753 
After adding a Gain block and an annotation(hit brief spacebar for model's "zoom to fit"). Now the proportions are:
get_param('model_wrong_proportions','PaperPosition') ans =  7.8061    5.0457   14.0651   10.8926
Proportions have changed, even though the inserted block is within the margins of the prior elements defined. 

 Accepted Answer

The change in the above proportions is due to the 'PaperPositionMode' printing property of the model being set to the default value of 'auto'. By changing this property to 'manual', the 'PaperPosition' output becomes consistent after adding the block annotation within margins. You can achieve this as follows:
get_param('model_wrong_proportions','PaperPositionMode')
The above should return 'auto'. To change it to 'manual', follow:
set_param('model_wrong_proportions','PaperPositionMode', 'manual')
Now, if you get the PaperPosition values, they should be similar to the scenario after inserting blocks within the paper margins. For more information on this property, you can access the release-specific documentation by executing the following command in the MATLAB R2020b command window:
>> web(fullfile(docroot, 'simulink/ug/print-from-the-matlab-command-line.html'))
For additional information regarding the current release, please follow the link below:

More Answers (0)

Products

Release

R2018b

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!