Validate dynamic component attribute field

Hi,
I would like to validate a dynamic component attribute field, such that it should take value between 600-900 mm.,I.e the width of the cabinet. Somewhere I read in the forum, but unable to get back.
Can someone help
Thanks

=largest(60,smallest(90,length))
where length could be current(“lenx”)*2.54 or an some other input

1 Like

Thanks Philip

Hi.,

But the formula in the DC vanishes, when i input the value in the Component options dialog

BOX_11.skp (988.0 KB)

Of course it does. The formula goes into the LenX attribute, and it calculates its value based on what the user inputs into the A1_Width field.

hi

@Anssi

referring to another thread by philip. where the lenx is the current attribute field, which validates the data and retains in the field itself. (which i am trying to emulate) (option-01)
Another option provided is referencing another attribute, ( Height) (Option 02)
Both works correctly in that skp file of the thread.
But for me the first option fails. where i am making mistake.

Current is best reserved for the inbuilt attributes, with the custom ones it returns a different value.

For custom attributes current returns the object reference, so if I had a group of attributes
val1,val2,val3
then
=current(“val” & num) would return the one of the listed attributes based on the num if it is either 1,2 or 3 otherwise an error

I added another attribute to recieve the input. then filtered that with the conditions

BOX_11.skp (765.3 KB)

hi.,
thanks.,
is this the field added A1_WIDTH_S?,

You are right, I used a temporary attribute first, then replaced exist
I did this morning before work then forgot what I had done before posting this afternoon.

@pcmoor
Thanks