Range for entering value


#1

Hey Sketchuppers,

In a Dynamic Component I’d like one variable to be editable by users. The value should be a variable in millimeters. Users should be able to enter any value (number in mm), however I’d like that value to be accepted only within a certain arrange of numbers. Let’s say only values between 200 and 800 mm should be accepted.
Could anybody help me to set this up?

Small side question:
As a user of the metric system, I always have to set the value-type to text, since ‘millimeter’ will mess up everything. It seems like there a bug which turns decimals into inches, even if everything is set to decimals. I’m hoping one of the next presidents of the US will decide to convert to the metric system, just like here in Europe, but since that moment might never arrive… Who has similar issues?


#2

=if(current(“lenx”) * 2.54<20,20,smallest(current(“lenx”) * 2.54,80))

metric is okay, just need to make sure value is cm, and convert any functions that returns inches

component sample that can be scaled only within the range

square.skp (9.8 KB)

added another to allow option for dialog input and rounded to nearest mm
square2.skp (11.1 KB)


#3

Thanks! The squares are no component though… can’t do anything with them


#4

actually
= largest(20,smallest(value,80) )
is probably the simplest

the squares have been saved as components, (this is done via right click menu when created) the file needs to be placed into the drawing not opened.

attached file with both components placed
squares.skp (21.6 KB)


#5

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.