Dynamic material change via option generates new DC component

I created a simple transport container model as dynamic component. The darker areas are grouped as a sub component “ContainerShades”. The lighter areas are the main component “ContainerShort”.

Every time a place an instance of the DC and select a new color, a new DC (with that color) is created in the Sketchup components section, automatically named “ContainerShort#1”, “ContainerShort#2” and so on. One for each new color I select in the DC attributes window. This leads to the big problem that the DCs do not belong to each other anymore. Changing the size of the blue containers does not affect the red/green/yellow containers. But I only want the colors to be dynamic. The dimensions should be edited centralized in ONE dynamic component. I think that is the whole point of DC, isn’t it?

I hope you understand my problem. Help is appreciated :slight_smile:

SKP file is attached.

P1SIM_Indoor_View.skp (510.9 KB)

multiples

If i do not use sub components it works fine:

With “fine” I mean that no extra component is created in the component tab. And if I edit the size the sizes of both components are synchronized.

But that does not help me, since I really want to use the sub components so that I can have two different dynamic materials.

That’s just the way DCs work. If you think about it, if you change something inside a DC, it’s no longer identical to its original, so it has to make a new component definition.

However, if instead of changing the colour or material from an Option IN the DC, you were just to use the Paint Bucket tool to apply the colour to the whole component, that applies only to the component instance, and doesn’t need a new component definition. So all the differently coloured instances share the same definition. Edit one, and the others all change to match.

Would that do what you want? From your images, it looks that it probably would.

If you want inside and outside to be different colours, and you only want to change the inside colour, then assign a fixed colour to the faces of the outside component and leave the inside component with all faces as the default material. Then a colour applied using the Paint Bucket tool to tge whole top level ‘outside’ component will only affect the default material.

PS. Answering on my phone so can’t immediately try this on your model, but will look at it shortly later tonight.

I see more clearly now what you are trying to do, having looked at your model and the Dynamic Attributes.

You want to be able to select a light shade of colour for the outer component Container Short, and a darker shade of the same colour for the two inner (ContainerShades) components, using one drop down selector in Component Options.

So you have at least 8 materials - four colours each in two shades: light and dark.

If you want to be able to edit all ‘similar’ components for size, but keep the colours different, I don’t think you can do it the way you are trying to, for the reasons I outlined in my original post.

I’m wondering though, if you put a third component, permanently coloured black, behind the ‘shades’ components, and made them partly transparent but of the same colour as the outer component, whether the black behind transparent would show as a darker shade?

Let me try that, and get back to you.

[LATER]

Well, I have the basis of a solution.

I’ve duplicated the ContainerShades component, made one unique, and coloured the faces of the copy a 50% transparent gray, and put it 10mm in front of the original ContainerShades (so as to avoid Z-fighting). Then moved the pair back 10mm so the front (transparent grey) is flush with the outer container shell, and mirrored the pair to the back of the outer container. (By the way, the back face of your outer container was reversed, with the inside out. I fixed it).

You can now apply different colours using the paint bucket to the whole component, to get this appearance.


Four instances of one component.

Container.skp (69.5 KB)

Does this give the look you wanted?

Now if you want, add dynamic attributes to change the sizes of the containers.

And if you want the shaded panels to look more ‘solidly recessed’ you could extend the coloured back to include sides up to the front, and/or increase the separation of the two copies. As they are, you get an impression of recessed panel, but up close you can see the gap.

I’m not at all sure what would happen if you try to make the colour a dynamic option now - it would probably still create a new component definition for each colour, but it’s after midnight here in UK, and I’m off to bed.

Thank you for your help! So there is no possibility to have multiple dynamic materials in one DC? Then I probably have to use two DCs and group them together.

You can, but as you found, each new instance becomes a unique component.

Using this shading technique, you could try and see what happens if you can apply the colour only to the ‘outside’ (i.e., the whole) of your DC.