Dynamic component Logical Functions

Hello …,

I’m trying to create a dynamic component and I want to use a logical function.

IF(test, thenValue, elseValue)

I want to resize the LenY and LenZ and I want to use a list for LenX

I tried this but this doesn’t work.
IF(LenX=“216.936843 cm”,”3.389638 cm”,”3.813343 cm”)

Can somebody tell me what I am doing wrong?

Without testing - I’m away from my SU computer - I’d say that you are testing for text values and setting text values. Try using the numbers without the quotation marks or the units.

1 Like

I did try that but it doesn’t work

One other detail: Start with “=”

That’s about as far as I can go right now. I’ll be away from my SU computer all day.

If others want to chime in, it would help if you provide a copy of the component for others (and me if not solved when I return home) want to take a closer look.

It does partly the work, but the LenY and LenZ automatically go to zero

1 Like

I think we’re at the point where you really need to upload the component so that we can look at it. It would also help if you describe more fully what you’re trying to accomplish.

LenX, LenY and LenZ are distinct values. If you’ve only entered a formula once in LenX, then it can’t affect LenY or LenZ.

Untitled.skp (54.8 KB)

I uploaded the model with the component

1 Like

remove the quotation marks in the conditional formula, otherwise they would be valued as strings (=0), recommend set the value in the dropdown to centimeters rater than default

Thanks, the basic LenY and LenZ are right now, but the size of those 2 doesn’t change

because the units behind DC design is inches then the equal appears to have conversion discrepancies

Try =IF(LenX>=216.936843,3.389638,3.813343), this works, so demonstrates that the significance in the conversion is a problem

generally its better to use choose(index(“adropdown”,value,…)), however it appears you need to use a custom attribute as index(“Lenx”) returns -1 Which indicates can not find. Moreover, the grey out values in lenx tends to suggest independent behavior

attached example
Untitled (5).skp (55.7 KB)

Thanks :slight_smile: