[Question] Resizing through Shapesheet with Locked Aspect Ratio

Started by Kabino, July 18, 2016, 06:25:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kabino

Hi guys, I am trying to resize a shape through code by modifying its height/width in its shapesheet while maintaining the aspect ratio. However, even though I have LockAspect = 1, when I type in a different height/width, the aspect ratio is not maintained. The only way I can maintain the aspect ratio is by dragging the resize boxes on the shape itself. I need to be able to change the height/width in the shapesheet because I am trying to contain the shape within another shape.

wapperdude

Yep.  Code changes ignore Aspect ratio lock.  You have to enter values for both width and height.

What you can do, since it's code, read the current Height, Width and make an aspect ratio factor (ARF).  Then, set, e.g., the width.  Next, set the height = width * ARF or width/ARF depending upon how you defined ARF.

Wapperdude

Visio 2019 Pro