Main Content

createSubGroup

Create subgroup in element group of view

Since R2021a

    Description

    subGroup = createSubGroup(elementGroup,subGroupName) creates a new subgroup subGroup, named subGroupName within the element group elementGroup of an architecture view.

    Note

    This function cannot be used when a selection query or grouping is defined on the view. To remove the query, run removeQuery.

    example

    Examples

    collapse all

    Open the keyless entry system example and create a view newView.

    openProject("scKeylessEntrySystem");
    model = systemcomposer.loadModel("KeylessEntryArchitecture");
    view = model.createView("newView");

    Open the Architecture Views Gallery to see the new view newView.

    model.openViews
    

    Create a subgroup myGroup.

    group = view.Root.createSubGroup("myGroup")
    group = 
      ElementGroup with properties:
    
             Name: 'myGroup'
             UUID: '539fa2cf-629b-4e28-82df-41365aa6cedb'
         Elements: []
        SubGroups: [0×0 systemcomposer.view.ElementGroup]
    
    

    Input Arguments

    collapse all

    Element group for view, specified as a systemcomposer.view.ElementGroup object.

    Name of subgroup, specified as a character vector or string.

    Example: "myGroup"

    Data Types: char | string

    Output Arguments

    collapse all

    Subgroup, returned as a systemcomposer.view.ElementGroup object.

    More About

    collapse all

    Version History

    Introduced in R2021a