Main Content

addElement

Add component to element group of view

Since R2021a

    Description

    addElement(elementGroup,component) adds the component component to 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 newView.

    model.openViews
    

    Add an element to the view by path.

    view.Root.addElement("KeylessEntryArchitecture/Lighting System/Headlights")

    Add an element to the view by object.

    component = model.lookup(Path="KeylessEntryArchitecture/Lighting System/Cabin Lights");
    view.Root.addElement(component)

    Input Arguments

    collapse all

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

    Component, specified as a systemcomposer.arch.Component object, a systemcomposer.arch.VariantComponent object, an array of systemcomposer.arch.Component objects, an array of systemcomposer.arch.VariantComponent objects, the path to a component, or a cell array of component paths.

    Example: "KeylessEntryArchitecture/Lighting System/Headlights"

    Data Types: char | string

    More About

    collapse all

    Version History

    Introduced in R2021a