# Snapping to a smallest or largest size (Ajustando para um tamanho menor ou maior)

Hi!

I had a problem using “CURRENT”, I solved the problem as follows:

=ROUND(IF(PNAAMBIENTE!LenX<=PNAAMBIENTE!MinimumX, PNAAMBIENTE!MinimumX, IF(PNAAMBIENTE!LenX>=PNAAMBIENTE!MaximumX, PNAAMBIENTE!MaximumX, PNAAMBIENTE!LenX))/PNAAMBIENTE!ROUND)*PNAAMBIENTE!ROUND

The problem is that in this way it limits only the internal component, leaving the external with a different measurement, without warning in the component options, would anyone have a solution for this?

Or

A simpler solution?

The example uses current, smallest(largest, value) as a range and ceiling which allows significance like 0,5 (half meter)
You need to choose the method of input, scale or option text box, so input is not overridden

Block with hole example.skp (82.0 KB)
Examples from left to right, scale only, text box input only and then option to choose,

Thank you, that would be it, but could you explain to me why the need for multiplication (or division) in the CURRENT formula? In this case by 2.54.

“Current”, when directly used in the size attributes returns inches not centimetres, a bug which one has too work around with a conversion.
“FaceArea” is a function that is noted to return square inches, so convert with 2.54*2.54.

1 Like

thanks, this bug that was bothering me