UI hint for collapsing booleans

jelte_steur_info
jelte_steur_info Member Posts: 683 PRO
In the native Extrude feature, there are these boolean annotations with a blank 'group' arrow in front of it. when the boolean is selected, the 'group' expands.

What UIHint can I use to get that same behaviour? when I group parameters, there is always a group name taking up a line and when collapsed, hiding the first boolean.

Comments

  • EvanReese
    EvanReese Member, Mentor Posts: 3,100 PRO
    edited May 2024
    It's not a UIHint. It's a "driving parameter" field. Look here for the info. https://cad.onshape.com/FsDoc/uispec.html

    annotation { "Name" : "Additional Options" }
    definition.additionalOptions is boolean;
    
    if (definition.additionalOptions)
    {
        annotation { "Group Name" : "Options", "Collapsed By Default" : false, "Driving Parameter" : "additionalOptions" }
        {
            annotation { "Name" : "Option" }
            definition.option is string;
        }
    }

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • jelte_steur_info
    jelte_steur_info Member Posts: 683 PRO
    edited June 2024
    Thanks @Evan_Reese. Got it to work