Setting the height of a group to a multiple of 1/4"

Started by kayakerinme, April 03, 2011, 02:53:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kayakerinme

There's got to be a way to do this that I'm just not seeing, so any formula help or a pointer to a reference would be greatly appreciated. (First post here though I've found lots of great information.) I'm also not sure just what to search on to find a prior solution here on the forum.

I have a group that's comprised of three shapes. Each of the three shapes sets its own height to the textheight of thetext. The group shape is the sum of the three heights, and is protected. So far so good.

However, I'd like the group to size itself to the nearest 1/4". For example, if the text on the top sizes to 0.375", the text in the middle to 0.563", and the text in the bottom to 0.688", that sizes to 1.626" but I'd like that to jump to 1.75" as the next largest 1/4" measurement.

I've been playing with the bottom rectangle and that height, but I'm not coming up with the right math or formula. In this example, the heights should stay 0.375", 0.563", and the bottom becomes 0.812".

If the height of the top enlarges to 0.720", the middle stays 0.563", and the bottom textheight is still 0.688, then it should jump to 2.000" instead of the sum 1.971".

Make sense? What am I missing?

Thanks!

vojo

tricky...but can use setatref functions in the width/height for this.

kayakerinme

Fresh eyes in the morning, some playing in Excel, and a solution!

Sheet.1 is the top region, Sheet.2 is the middle, and Sheet.3 is the bottom.
Sheet.4 is the group.

Sheet.1!Height = Textheight(thetext,width)
Sheet.2!Height = Textheight(thetext,width)
Sheet.3!Height is the one I want to round to the nearest 1/4" using the following formula. This also sets the minimum height of that text block to 0.688, or to the height of the text, whichever is larger.

Sheet.3!Height = 0.25+Sheet.1!Height+Sheet.2!Height+(MAX(0.688,TEXTHEIGHT(TheText,Width)))-MODULUS(0.25+Sheet.1!Height+Sheet.2!Height+(MAX(0.688,TEXTHEIGHT(TheText,Width))),0.25)-Sheet.1!Height-Sheet.2!Height

I think it might have been easier to create a Scratch value or two but this'll work.

Thanks for looking. I hope someone else finds this useful at some point  :)