Changing Colors Dynamic Component

I have created a dynamic componat that has 2 options to change the materials on 2 diffrent parts in the componant.
What I want to do i just to make 1 option that switches the materials on both those parts with the same option.
It has to be 2 different materials for the 2 parts.
Here is a link to the file:

Any1 that can help?

Use an If Statement in the materials.
If the Parent (overall) option says Material 1
Then the 2 parts’ materials will be whatever 2 different combo you want

Thanks for the quick reply, however Im not able to get it to work. Im getting this error message when I put in the function. I probably have the wrong function or something, can you tell me whats wrong?

I think that you are making this too complex. Just set the Material attribute equal to the value selected by the user:

For the Topp, Material = (then click on the Custom Topp value) then hit Enter. After this, when you change the top material in the UI and click Apply, it changes.

Well the thing is:
Lets say I have component of two cubes, Cube 1 and Cube 2.
When I select color scheme “A”, Cube 1 will be Red and Cube 2 will be Green.
When I select color scheme “B”, Cube 1 will be Blue and Cube 2 will be Yellow.

This is the principle that I am after, I dont want change the cubs materials separately.

Thanks for the reply anyway.

In that case… yes, you will need to set a “flag” with the UI and have the material change, based on that flag.

You do, however, have to load the material into the model first.

Yes i am aware of that. But how does the formula look like to get it to work.
Or am I doing this wrong?

I have attached a simple model.If Function.skp (84.4 KB)

Hey, not on a computer to check, but it’ll be something like this:
The parent attribute:
Custom Atttribute: a dropdown menu where you assigned Scheme A a value of A

Child attribute for Cube 1
Material= IF(Parent!Custom=“A”,ColourRed,ColourBlue)

Child attribute for Cube 2
Material= IF(Parent!Custom=“A”,ColourBlue,ColourYellow)

This is what I have been trying to do but cant get it to work. :frowning:

Made it work, need to put the material I wanted to use between “”. :slight_smile:

Thanks for all the help and have a nice day!

Gah! I knew it was something like that! Good job figuring it out!