Main Content

addAnnotation

Create new annotation in interaction

Since R2024b

    Description

    annotation = addAnnotation(interaction,text) creates an annotation in the sequence diagram corresponding to interaction interaction with text text.

    example

    Examples

    collapse all

    Create a model with a component called Component.

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

    Create a sequence diagram in the model, and then open the sequence diagram.

    interaction = model.addInteraction("NewSequenceDiagram");
    interaction.open

    Add a lifeline to the sequence diagram.

    lifeline = interaction.addLifeline(comp);

    Add an annotation to the sequence diagram.

    annotation = interaction.addAnnotation("This is my sequence diagram.");

    Input Arguments

    collapse all

    Interaction, specified as a systemcomposer.interaction.Interaction object.

    Text, specified as a character vector or string.

    Example: "This is my sequence diagram."

    Data Types: char | string

    Output Arguments

    collapse all

    Annotation, returned as a systemcomposer.interaction.Annotation object.

    More About

    collapse all

    Version History

    Introduced in R2024b