Visio Guy

Visio Discussions => General Visio => Topic started by: AnotherNoOne on July 24, 2017, 07:46:01 AM

Title: Bound variables for height/width
Post by: AnotherNoOne on July 24, 2017, 07:46:01 AM
Hi,
i want to make a square, wich can be resized via pushing/pulling like usually.
The problem: the height and width only should be a multiple of 5mm (5,10,15,.....)
Is there a Operator/Formula to only allow for certain values to be the height/width?

Thx for the help in advance!
Title: Re: Bound variables for height/width
Post by: AnotherNoOne on July 24, 2017, 08:30:24 AM
Idiot gonna be an idiot, its the BOUND function -.-

But is there any way to not set each single value ( 5,10,15,20,25,30,....) but more like "y=x*5"?
Title: Re: Bound variables for height/width
Post by: Yacine on July 24, 2017, 10:32:32 AM
Bound is a solution, but you need to put all the values inside.

Try this post: http://visguy.com/vgforum/index.php?topic=1463.0
Title: Re: Bound variables for height/width
Post by: AnotherNoOne on July 24, 2017, 10:34:19 AM
Thank you very much :D
Title: Re: Bound variables for height/width
Post by: AnotherNoOne on August 07, 2017, 07:56:47 AM
So, is there a way for Visio to accept something like Height=5*Height...
So i dont have to put in every possible number, but it works for every multiple of 5?

Title: Re: Bound variables for height/width
Post by: Yacine on August 07, 2017, 08:35:24 AM
I don't understand your question. I thought you found the solution in the post I recommended?
Title: Re: Bound variables for height/width
Post by: Yacine on August 07, 2017, 08:40:23 AM
Another solution can be to use the setatref functions ( https://msdn.microsoft.com/de-de/library/office/ff765523.aspx )

Wapperdude taught me to use a dummy cell to get it working.
eg user.height
the height cell itself would get the formula: SETATREF(user.height,SETATREFEVAL(INT(SETATREFEXPR()/5)*5))
Title: Re: Bound variables for height/width
Post by: AnotherNoOne on August 07, 2017, 08:42:04 AM
Thanks, thats exactly what i was looking for
Title: Re: Bound variables for height/width
Post by: wapperdude on August 07, 2017, 03:50:56 PM
The provided formula does do what is needed, but, it does not place a limit on the minimum height.  So, the height could be set to zero, which then becomes somewhat problematical.

The attached file, looks at the width, but could be easily modified for height.  There are two shapes.  The first places a simple 1" minimum width.  The second allows for text entry, and places a minimum width based upon the text entered or the 1" minimum.  These are "hard coded" in the shapesheet formulas.

Wapperdude
Title: Re: Bound variables for height/width
Post by: AnotherNoOne on August 08, 2017, 08:38:40 AM
Thanks, thats even better. My colleagues kept complaining about the rectangle to be able to shrink to 0x0, and then no be able to click on it, now thats fixed!