Main Content

createView

Create architecture view

Since R2021a

    Description

    view = createView(model,name) creates a new architecture view view for the System Composer™ model model with the specified name name.

    To delete a view, use the deleteView function.

    view = createView(___,Name=Value) creates a new view with additional options.

    example

    Examples

    collapse all

    Open the keyless entry system example and create a view. Specify the color as light blue and the query as all components, and group by the review status.

    import systemcomposer.query.*
    
    openProject("scKeylessEntrySystem");
    
    model = systemcomposer.loadModel("KeylessEntryArchitecture");
    view = model.createView("All Components Grouped by Review Status",...
        Color="lightblue",Select=AnyComponent,...
        GroupBy="AutoProfile.BaseComponent.ReviewStatus");

    Open the Architecture Views Gallery to see the new view named All Components Grouped by Review Status.

    model.openViews
    

    Input Arguments

    collapse all

    Architecture model, specified as a systemcomposer.arch.Model object.

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

    Example: "All Components Grouped by Review Status"

    Data Types: char | string

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

    Example: view = model.createView("All Components Grouped by Review Status",Color="lightblue",Select=AnyComponent(),GroupBy="AutoProfile.BaseComponent.ReviewStatus")

    Selection query to use to populate the view, specified as a systemcomposer.query.Constraint object.

    A constraint can contain a subconstraint that can be joined with another constraint using AND or OR. A constraint can be negated using NOT.

    Query Objects and Conditions for Constraints

    Query ObjectCondition
    PropertyA non-evaluated value for the given property or stereotype property.
    PropertyValueAn evaluated property value from a System Composer object or a stereotype property.
    HasConnectorA component has a connector that satisfies the given subconstraint.
    HasPortA component has a port that satisfies the given subconstraint.
    HasInterfaceA port has an interface that satisfies the given subconstraint.
    HasInterfaceElementAn interface has an interface element that satisfies the given subconstraint.
    HasStereotypeAn architecture element has a stereotype that satisfies the given subconstraint.
    IsInRangeA property value is within the given range.
    AnyComponentAn element is a component and not a port or connector.
    IsStereotypeDerivedFrom A stereotype is derived from the given stereotype.

    Example: view = model.createView("All Components Grouped by Review Status",Select=HasStereotype(IsStereotypeDerivedFrom("AutoProfile.HardwareComponent")))

    Grouping criteria, specified as a cell array of character vectors or an array of strings in the form "<profile>.<stereotype>.<property>". The order of the cell array dictates the order of the grouping.

    Example: view = model.createView("All Components Grouped by Review Status",GroupBy=["AutoProfile.MechanicalComponent.mass","AutoProfile.MechanicalComponent.cost"])

    Data Types: char | string

    Whether to search for reference architectures, specified as 1 (true) or 0 (false).

    Example: view = model.createView("All Components Grouped by Review Status",IncludeReferenceModels=false)

    Data Types: logical

    Color of view, specified as a character vector or string that contains the name of the color or an RGB hexadecimal value.

    Example: view = model.createView("All Components Grouped by Review Status",Color="blue")

    Example: view = model.createView("All Components Grouped by Review Status",Color="#FF00FF")

    Data Types: char | string

    Output Arguments

    collapse all

    Architecture view, returned as a systemcomposer.view.View object.

    More About

    collapse all

    Version History

    Introduced in R2021a