2

I want to be able to hide a certain parameterGroup option depending on a parameter thats set. I'm trying to make a kind of Advanced Mode, so when I set a parameter to Enable Advanced Mode to True, this shows on one of the options, for example...

"parameterGroups": [
    {
        "key": "grpOptions",
        "labels": {
            "en": "Options"
        },
        "collapsed": false,
        "sort": 20
    },
    {
        "key": "advOptions",
        "labels": {
            "en": "Advanced Options"
        },
        "collapsed": false,
        "visible":"(company=='BetatTest')",
        "sort": 10
    }
],
"parameters": [
    {
        "key": "advancedMode",
        "enabled": true,
        "visibleAsGlobal": true,
        "group": "advOptions",
        "visible":"(company=='BetaTest')",
        "global":true,
        "type": "String",
          "labels": {
            "en": "Advanced Settings?"
        },
        "defaultValue":"No",
        "validValues": [
            "No",
            "Yes"
       ]
    },
Michael Todd
  • 211
  • 1
  • 3

1 Answers1

2

Unfortunately ParameterGroup does not provide the property visible. https://docs.roomle.com/scripting/resources/model/configurator/ConfigurationFormat.html#json-objects



This stems from the premise that a certain ParameterGroup is only visible if at least one Parameter assigned to it is visible.

Here is a small example: http://rml.co/UbSJ

{
"id": "isdt:advanced_mode_group_invisible_example",
"parameterGroups": [
    {
        "key": "grpOptions",
        "labels": {
            "en": "Options"
        },
        "collapsed": false,
        "sort": 20
    },
    {
        "key": "advOptions",
        "labels": {
            "en": "Advanced Options"
        },
        "collapsed": false,
        "sort": 10
    }
],
"parameters": [
    {
        "key": "company",
        "enabled": true,
        "visibleAsGlobal": true,
        "group": "grpOptions",
        "visible": true,
        "global": true,
        "type": "String",
        "labels": {
            "en": "Test Mode?"
        },
        "defaultValue": "AlphaTest",
        "validValues": [
            "AlphaTest",
            "BetaTest"
        ]
    },
    {
        "key": "advancedMode",
        "enabled": true,
        "visibleAsGlobal": "(company == 'BetaTest')",
        "group": "grpOptions",
        "visible": "(company == 'BetaTest')",
        "global": true,
        "type": "String",
        "labels": {
            "en": "Advanced Settings?"
        },
        "defaultValue": "No",
        "validValues": [
            "No",
            "Yes"
        ]
    },
    {
        "key": "fancyAdvancedOption1",
        "enabled": true,
        "visibleAsGlobal": "(advancedMode == 'Yes' && company == 'BetaTest')",
        "group": "advOptions",
        "visible": "(advancedMode == 'Yes')",
        "global": true,
        "type": "Integer",
        "labels": {
            "en": "Fancy advances option 1"
        },
        "defaultValue": 1,
        "valueObjects": [
            {
                "value": 1,
                "labels": {
                    "en": "Fancy Option 1"
                }
            },
            {
                "value": 2,
                "labels": {
                    "en": "Fancy Option 2"
                },
                "condition": ""
            }
        ]
    },
    {
        "key": "fancyAdvancedOption2",
        "enabled": true,
        "visibleAsGlobal": "(advancedMode == 'Yes' && company == 'BetaTest')",
        "group": "advOptions",
        "visible": "(advancedMode == 'Yes')",
        "global": true,
        "type": "Integer",
        "labels": {
            "en": "Fancy advances option 2"
        },
        "defaultValue": 1,
        "valueObjects": [
            {
                "value": 1,
                "labels": {
                    "en": "Fancy Option 1"
                }
            },
            {
                "value": 2,
                "labels": {
                    "en": "Fancy Option 2"
                },
                "condition": ""
            }
        ]
    }
],
"subComponents": [],
"geometry": "
    BeginObjGroup('coordinates');

        BeginObjGroup('X');
            Cylinder(5, 5, 1000, 100, 100, 100);
             RotateMatrixBy(Vector3f{0, 1, 0}, Vector3f{0, 0, 0}, 90);
        EndObjGroup();
         SetObjSurface('fantoni_1:AS19');

        BeginObjGroup('Y');
            Cylinder(5, 5, 1000, 100, 100, 100);
             RotateMatrixBy(Vector3f{1, 0, 0}, Vector3f{0, 0, 0}, -90);
        EndObjGroup();
         SetObjSurface('fantoni_1:C649');

        BeginObjGroup('Z');
            Cylinder(5, 5, 1000, 100, 100, 100);
             RotateMatrixBy(Vector3f{0, 0, 1}, Vector3f{0, 0, 0}, 90);
        EndObjGroup();
         SetObjSurface('fantoni_1:C669');

        Cube(Vector3f{100, 100, 100});

    EndObjGroup();
",
"parentDockings": {
    "points": [],
    "ranges": [],
    "lines": [],
    "lineRanges": []
},
"childDockings": {
    "points": []
},
"siblings": [],
"articleNr": "",
"pricing": [],
"validChildren": []

}

alexfeh
  • 101
  • 5