Problems with dynamic component

Hi every one. Hope everyone had a Merry Christmas :slight_smile:


I have a challenge.

I have a simple dynamic component that I would like to have to change color when I scale or even more importantly use push / pull.

This is only in the longitudinal direction.

What you see here is just a short version of the final programming.

=if(And(current(“LenX”)>0,current(“LenX”)<11.7,“Color A02”,If(And(current(“LenX”)>11.7,Current(“LenX”)<23.5,“Color A05”,If(And(current(“LenX”)>23.5,current(“LenX”)<35.3,“Color B02”,“Color I03”))))))

As you can see in the pictures I have made the beam (the red one on the left) which has to change color every 300 mm

so when it is 0-300 = pink, 300-600 = red etc.

My problem is that it does NOT change color automatically when I use push / pull.

Therefore I tried with “current” but it does not work :frowning:

anyone have an idea?

When you create a DC, it records the bounding box measurements and stores it internally for use with the scale options. Therefore, editing with the pushpull or move tool (inside) won’t be notified.
DC works with scaling, only.

1 Like

as per Jack, but to get the lenX to update place a sub-component in the object with at least one attribute. As Jack would further recommend use choose instead of nested if statements, I suggest you use the embedded color code there is a list here,

an example:
color per lenx.skp (30.9 KB)

I thought you were using inches (you did to avoid the 2.54 for current,), however principle same.