Naming conflict bug in dynamic components

I have two DCs that should be independent of one another. If I bring either one of them into a new model, they work as expected. However, if I bring in both to the same model, whichever DC is brought in second doesn’t work correctly.

The problem is because I reused some internal components without changing names and Sketchup failed to rename these definitions with #n incrementor even though the components were not identical.

I’m guessing it is because they are identical except the code in attributes so Sketchup assumes the definitions are identical without checking their code. Just guessing at this one…

Try it out. I’m attaching two DCs as SKPs. Follow this sequence to see the problem:

  • drop the SlidingDoor.skp in a new model (we don’t have enough sliding doors DCs yet :slight_smile:
  • stretch it and note that the stiles and rails are correctly sized after the stretch
  • delete it
  • purge unused
  • drop the CabinetDoor.skp in the model
  • drop the SlidingDoor.skp next to it
  • stretch the SlidingDoor component and you will see the stiles and rails don’t all work right

Now look at the definitions of the attributes Left, Right and Top in the SlidingDoor DC and you will see they have not been renamed with #1 and in the CabinetDoor DC there are identical definitions. For some reason, the attribute Bottom in the CabinetDoor DC became Bottom #1 in the SlidingDoor DC as they all should have.

SlidingDoor.skp (598.6 KB) CabinetDoor.skp (452.7 KB)

The fix:
insert SD into a file, then on each sub in door, using outliner, right click, scale definition
then when you bring the other cabinet door all good. They become unique.

Generally its good practice to use a common file to build components with reused subs and make each unique after copying.

parent! can be helpful if using same attribute with different parent headers.

I can’t quite find why some components become unique and others do not, groups are even worst, if I copy a group, then I have to use a script to make them unique.