3

I have an issue that I have created 4 derived Products from a single part, that each part has a different Colour / Material set within it. I have the 4 Products called as PossibleChildren in my main part but when I try and bring in one of the 4 Products which ever is the first colour I pick, is the only colour that will select, so if for example I select RED for my first part, if I then pick the BLUE part it still only places the RED part. I created the 4 Products by importing this text...

"item_id","configuration"
"sub_s2_8t15","{""componentId"":""racksystems_test:sub_fronttile"",""parameters"": 
{""tileColour"":""racksystems_test:s2_8t15""}}"
"sub_s2_7t58","{""componentId"":""racksystems_test:sub_fronttile"",""parameters"": 
{""tileColour"":""racksystems_test:s2_7t58""}}"
"sub_s2_4t50","{""componentId"":""racksystems_test:sub_fronttile"",""parameters"": 
{""tileColour"":""racksystems_test:s2_4t50""}}"
"sub_twinwall","{""componentId"":""racksystems_test:sub_fronttile"",""parameters"": 
{""tileColour"":""racksystems_test:twinwall""}}"

And then in the master.json part I call the 4 created Products...

   "itemId": "racksystems_test:sub_s2_8t15",
    "condition":"((version=='Rack')&&(company=='BetaTest'))"
},  {
    "itemId": "racksystems_test:sub_s2_7t58",
    "condition":"((version=='Rack')&&(company=='BetaTest'))"
},  {
    "itemId": "racksystems_test:sub_s2_4t50",
    "condition":"((version=='Rack')&&(company=='BetaTest'))"
},  {
    "itemId": "racksystems_test:sub_twinwall",
    "condition":"((version=='Rack')&&(company=='BetaTest'))"
}, 

I have a KEY in the sub_fronttile.json as this..

   {
        "key": "tileColour",
        "type": "Material",
        "labels": {
            "en": "Tile Colour?"
        },
        "defaultValue": "",
        "valueObjects": [
            {
                "value": "racksystems_test:red",
                "labels": {
                    "en": "Black"
                }
            },
   ........

Then call the colour in my geometry like this...

    AddCube(Vector3f{infillWidth-20,materialThickness,infillHeight-20});
    SetObjSurface(tileColour);
    MoveMatrixBy(Vector3f{20,-offset,40});

So master.json is my main part and sub_fronttile.json contains my products

Michael Todd
  • 211
  • 1
  • 3

1 Answers1

2

Is tileColour a global parameter? If yes, then the global value is assigned on dock. If tileCoulour is not a global parameter, this should not happen unless an assignmentOnDock is used.

In order to workaround the assignment in global parameters, it might help to:

  1. have two parameters instead, tileColour_local, tileColour_global where one is global and not visible, other is not global and is visible.
  2. tileColour_global.onValueChange: "if (parameter.userTriggeredChange) { tileColour_local = tileColour_global; }
Jiri Polcar
  • 306
  • 1
  • 4