1

I have a file that is used to store all my colour choice, I bring the colour choices that I need into a part file using the Subcomponents (Supersedings)

       {
        "internalId": "externalCubbyCoverColourRack",
        "componentId": "racksystems_test:sub_mfccolours",
        "numberInPartList": "0",
        "active": "version=='Rack'",
        "supersedings": [
            {
                "type": "parameter",
                "key": "cubbyCoverColourRack"

            }
        ]
    },    {
        "internalId": "externalCubbyColourRack",
        "componentId": "racksystems_test:sub_mfccolours",
        "numberInPartList": "0",
        "active": "version=='Rack'",
        "supersedings": [
            {
                "type": "parameter",
                "key": "cubbyColourRack"
            }
        ]
    },

I have 2 colours that I bring in that are a Main Colour and a Cover Colour, when the main colour is selected it changes the Main Colour and I want it to change the Cover Colour too but if you change the Cover Colour only the cover colour changes. Is this possible to do with a KEY that's used from Subcomponents?

Michael Todd
  • 211
  • 1
  • 3

1 Answers1

1

Normally, it is recommended to use parameter onValueChange script. However, this is intended to work in a scope of a single component.

From your code, I think it should be possible to supersede both of them from a single subComponent instance. Then you can link the two parameters somehow in the sub_mfccolours itself, using parameter onValueChange script.

It is important to know, that every subComponent instance is its own component with its own internal data. If you have a reason to have two subComponents like this, it might help to add assignment "cubbyColourRack": "cubbyColourRack" to the externalCubbyCoverColourRack subComponent.

Jiri Polcar
  • 306
  • 1
  • 4