Drawing Scale behaves differently if set from from Page Setup or ShapeSheet

Started by ovi, August 10, 2022, 12:06:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ovi

Hello everyone,
I would like to change the drawing scale of a page in order to scale the shapes and make them fit the page.



As you can see from the screenshots above when I do it from Page Setup it works perfecly. But I have to make this change with code (this task is part of a bigger macro). The only way I found is to acces the "DrawingScale" cell of the PageSheet and change the value from there. The problem is that now the shapes don't appear to be scaled so they don't fit the page!



Why if set from page settings or from the ShapeSheet the behaviour is different? ???

How could I obtain the scaling as I want it (first screenshots) from a macro?

wapperdude

The difference is setting the Printer page size.  In your 1st example, in the lower right corner of the image you see drawing and printer page sizes are identical.  In the 2nd example, you see that they are not.  The macro needs to make these sizes identical.  As I recall, you need to also go to the Printer Page Setup tab, and set the scaling there to achieve page size matching.

Did you try macro recorder for getting code using procedure in 1st example?
Visio 2019 Pro

ovi

Thank you very much for the hints! I'm new to Visio and I haven't thought about looking at the code generated my a recorded macro. Nice tip!

The problem was that by changing DrawingScale from the PageSheet the page size was not updated automatically. Since the page size is mesured in mesurment units I had to scale that too.

So by mutiplying pageWidth and pageHeight by DrawingScale now Printer Paper size = Drawing Page size and the issue is solved.

Thank you again  :)