Main Content

getStereotypeProperties

Get stereotype property names on element

    Description

    propNames = getStereotypeProperties(archElement) returns an array of stereotype property names on the specified architecture of an element.

    example

    Examples

    collapse all

    Create a profile, add a component stereotype, and add properties with default values.

    profile = systemcomposer.profile.Profile.createProfile("LatencyProfile");
    stereotype = addStereotype(profile,"electricalComponent",AppliesTo="Component");
    stereotype.addProperty("latency",Type="double",DefaultValue="10");
    stereotype.addProperty("mass",Type="double",DefaultValue="20");

    Create a model with a component called Component.

    model = systemcomposer.createModel("archModel");
    systemcomposer.openModel("archModel");
    arch = get(model,"Architecture");
    comp = addComponent(arch,"Component");

    Apply the profile to the model and apply the stereotype to the component. Open the Profile Editor.

    model.applyProfile("LatencyProfile");
    comp.applyStereotype("LatencyProfile.electricalComponent");
    systemcomposer.profile.editor(profile)

    Get stereotype properties on the architecture of the component.

    properties = getStereotypeProperties(comp.Architecture)
    properties =
    
        1×2 string array
    
        "LatencyProfile.electricalComponent.latency"    "LatencyProfile.electricalComponent.mass"

    Input Arguments

    collapse all

    Output Arguments

    collapse all

    Property names, returned as an array of strings, each in the form "<profile>.<stereotype>.<property>".

    Data Types: string

    More About

    collapse all

    Version History

    Introduced in R2019a