How to snap to the nearest 1/16 between a maximum and minimum value

I’m trying to create a dynamic object that if scaled, will snap to a dimension that falls between a minimum and a maximum, and only to a value that falls on every 1/16" in between those values. Using the examples found on the Sketchup help site at Creating a Dynamic Component that snaps to a specific size | SketchUp Help, I’m essentially trying to find some way to combine the following 3 attributes:
LenX=ROUND(CURRENT(“LenX”)*16)/16 this snaps to a value every 1/16 inch
LenX=SMALLEST(CURRENT(“LenX”),20) this limits the dimension to a maximum of 20 inches
LenX=LARGEST(CURRENT(“LenX”),10) this limits the dimension to a minimum of 10 inches

Combining these three somehow will allow me to create an object that when scaled, will snap to every size between 10 and 20 inches in 1/16 inch increments, but a way to combine these three statements isn’t obvious to me.


HINT: You can nest function calls as one of the operands in another function call.


nearest 1 in 16 inch.skp (13.9 KB)

updated for range


where near is the above post

nearest 1 in 16 inch.skp (13.5 KB)