주요 콘텐츠

getCurrentAnnotation

R2026b

Get current annotation object

Description

annotationObj = getCurrentAnnotation gets the Simulink.Annotation object of the current annotation.

The current annotation is the most recently selected annotation. When you run an annotation callback function, the current annotation is the annotation whose callback is being invoked.

The function works on all three types of annotations: text, images, and areas.

example

Examples

collapse all

Suppose you have a model open in Simulink® that contains an annotation. Get the current annotation as a Simulink.Annotation object and then change the annotation text to My Text.

Select the annotation.

Get the current annotation.

a = getCurrentAnnotation;

Change the annotation text to My Text.

set(a,text = "My Text");

Output Arguments

collapse all

Current annotation, returned as a Simulink.Annotation object.

Version History

Introduced in R2019a