You need to import com.nomagic.magicdraw.sysml.util.SysMLProfile to use this API class.


Get a string constant for each property of stereotype (tag)

Usage includes “SysMLProfile.Stereotype.STEREOTYPE_NAME”.

For example, SysMLProfile.RequirementStereotype.ID returns a string of “Id”.


Get a stereotype element

Usage includes:

“SysMLProfile.getInstance(project).stereotype().getStereotype()” where project refers to a project that uses SysML Profile.

“SysMLProfile.getInstance(element).stereotype().getStereotype()“ where element refers to the element in a project that uses SysML Profile.

For example, SysMLProfile.getInstance(project).block().getStereotype() returns the reference to the «Block» stereotype object.


Check if an element is stereotyped

Usage includes  SysMLProfile.Stereotype.isInstance(Elem) where "Elem" is the element you want to check.

For example, given an element “Elem”, SysMLProfile.BlockStereotype.isInstance(Elem) returns True if the element “Elem” has «Block» stereotype applied and returns False otherwise.