Réserver une Démo
Pré. Proc.

Display Element/Connector Properties

A common component of a customized shape is a text string, which can include the name and value of one of the properties of the element or connector. To display the text, you use one of the commands:

  • print
  • println and
  • printwrapped

These all take a string parameter representing the text to be displayed. The element or connector property can be added to the text using the substitution macro #<propertyname>#; for example:

     println("name: #NAME#");

You can display several properties by issuing the commands several times, once for each property. The element and connector properties you can display are listed here. Additionally, you can display Tagged Values by prefixing the tag name with TAG, as shown:

     print("#TAG:condition#");

You can also test for and display an element's custom properties in the same way as you do the system-named properties; for example:

     if(hasproperty("Name","Value"))

     ...

and:

     print("#Name#");

Properties for Element Shape Scripts

  • actualname - same as 'name' except that it does not react to the 'Use Alias if Available' setting
  • addin - returns a value from an invoked Add-In function; syntax:
         addin:<addin_name>, <function_name>, <parameter> [, <parameter> ...]
    Note that in the hasproperty() argument, Enterprise Architect requires the hash characters for addin values:
         if(hasproperty("#ADDIN:MyAddin,MyValue#", "TheValue")) {
  • alias
  • author
  • bookmark
  • bookmarkvalue
  • cardinality
  • classifier
  • classifier.actualname - same as 'classifier.name' except that it does not react to the 'Use Alias if Available' setting
  • classifier.alias
  • classifier.metatype
  • classifier.name
  • classifier.stereotype
  • classifier.type
  • complexity
  • concurrency
  • datecreated
  • datemodified
  • diagram.author
  • diagram.handdrawn
  • diagram.mdgtype
  • diagram.mdgview
  • diagram.name
  • diagram.stereotype
  • diagram.type
  • diagram.version
  • ES (adds the End Stereotype character(s) as determined by the "Use extended << and >> characters" option)
  • haslinkeddocument
  • hiddenparents
  • incomingedge (returns "none", "left", "right", "top", "bottom", or "multiple")
  • isabstract
  • isactive
  • iscomposite
  • isdrawcompositelinkicon
  • isembedded
  • isinparent
  • isleaf
  • islocked
  • isroot
  • isspec
  • istagged
  • isvisible
  • keywords
  • language
  • metatype
  • multiplicity
  • name
  • notes
  • notesvisible
  • outgoingedge (returns "none", "left", "right", "top", "bottom", or "multiple")
  • packagename
  • packagepath
  • package.stereotype
  • parentedge ("right", "left", "top", "bottom")
  • parent.metatype
  • partition (returns "vertical" or "horizontal")
  • persistence
  • phase
  • priority
  • propertytype
  • propertytype.alias
  • propertytype.metatype
  • propertytype.name
  • propertytype.stereotype
  • qualifiedname
  • rectanglenotation
  • scope
  • showcomposeddiagram (returns "True" or "False")
  • SS (adds the Start Stereotype character(s) as determined by the "Use extended << and >> characters" option)
  • status
  • stereotype
  • stereotypehidden
  • subtype
  • type
  • version
  • visibility

Properties for Connector Shape Scripts

  • actualname - same as 'name' except that it does not react to the 'Use Alias if Available' setting
  • addin - returns a value from an invoked Add-In function; syntax:
         addin:<addin_name>, <function_name>, <parameter> [, <parameter> ...]
    Note that in the hasproperty() argument, Enterprise Architect requires the hash characters for addin values:
         if(hasproperty("#ADDIN:MyAddin,MyValue#", "TheValue")) {
  • alias
  • diagram.author
  • diagram.connectornotation
  • diagram.handdrawn
  • diagram.mdgtype
  • diagram.mdgview
  • diagram.name
  • diagram.stereotype
  • diagram.type
  • diagram.version
  • direction
  • effect
  • ES  - adds the End Stereotype character(s) as determined by the "Use extended << and >> characters" option
  • guard
  • isroot
  • isleaf
  • name
  • rotationdirection ("up", "down", "left", "right")
  • source.actualname - same as 'source.name' except that it does not react to the 'Use Alias if Available' setting
  • source.aggregation
  • source.alias
  • source.changeable
  • source.constraints
  • source.element.name
  • source.element.stereotype
  • source.metatype                      for details of these four source.metatype properties, see the
  • source.metatype.general               Define Metamodel Constraints Help topic
  • source.metatype.specific
  • source.metatype.both
  • source.multiplicity
  • source.multiplicityisordered
  • source.name
  • source.qualifiers
  • Source.RectangleNotation
  • source.stereotype
  • source.targetscope
  • SS  - adds the Start Stereotype character(s) as determined by the "Use extended << and >> characters" option
  • stereotype
  • target.actualname - same as 'target.name' except that it does not react to the 'Use Alias if Available' setting
  • target.aggregation
  • target.alias
  • target.changeable
  • target.constraints
  • target.element.name
  • target.element.stereotype
  • target.metatype
  • target.multiplicity
  • target.multiplicityisordered
  • target.name
  • target.qualifiers
  • Target.RectangleNotation
  • target.stereotype
  • target.targetscope
  • triggers
  • type
  • weight

Learn more