Display Element/Connector Properties

The commands print, println, and printwrapped all take a string parameter representing the text to be printed. Element and connector properties can be added to the text using the substitution macro #propertyname#.

For example: println("name: #NAME#");

In addition to the properties listed below, Tagged Values can also be displayed by prefixing the Tagged Value name with TAG:.

For example: print("#TAG:condition#");

You can also test against and display an element's custom properties in the same way as you do the named properties.

For example: if(hasproperty("Name","Value"))
               ...

and: print("#Name#");

Properties Visible to Shape Scripts

Properties for Element Shape Scripts

  • addin (value returned from an Add-In)
  • alias
  • author
  • cardinality
  • classifier
  • classifier.alias
  • classifier.metatype
  • classifier.stereotype
  • classifier.type
  • complexity
  • concurrency
  • datecreated
  • datemodified
  • diagram.mdgtype
  • diagram.name
  • diagram.stereotype
  • diagram.type
  • haslinkeddocument
  • isabstract
  • isactive
  • iscomposite
  • isembedded
  • isinparent
  • isleaf
  • islocked
  • isroot
  • isspec
  • istagged
  • keywords
  • language
  • metatype
  • multiplicity
  • name
  • notes
  • packagename
  • parentedge ("Right", "Left", "Top", "Bottom")
  • parent.metatype
  • partition ("horizontal", "vertical")
  • persistence
  • phase
  • propertytype
  • propertytype.alias
  • propertytype.metatype
  • propertytype.name
  • propertytype.stereotype
  • scope
  • status
  • stereotype
  • type
  • version
  • visibility.

Properties for Connector Shape Scripts

  • addin (value returned from an Add-In)
  • alias
  • diagram.connectornotation
  • diagram.mdgtype
  • diagram.name
  • diagram.stereotype
  • diagram.type
  • direction
  • isroot
  • isleaf
  • name
  • notes
  • source.aggregation
  • source.alias
  • source.changeable
  • source.constraints
  • source.element.name
  • source.element.stereotype
  • source.metatype
  • source.multiplicity
  • source.multiplicityisordered
  • source.qualifiers
  • source.stereotype
  • source.targetscope
  • stereotype
  • subtype
  • target.aggregation
  • target.alias
  • target.changable
  • target.constraints
  • target.element.name
  • target.element.stereotype
  • target.metatype
  • target.multiplicity
  • target.multiplicityisordered
  • target.qualifiers
  • target.stereotype
  • target.targetscope
  • type.