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 here, Tagged Values can be displayed by prefixing the Tagged Value name with TAG:
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
if(hasproperty("Name","Value"))
...
and:
print("#Name#");
There are further examples of Shape Scripts and commands in the Example Scripts topic.
Properties for Element Shape Scripts
• | addin (value returned from an Add-In) |
• | incomingedge (returns "none", "left", "right", "top", "bottom", or "multiple") |
• | outgoingedge (returns "none", "left", "right", "top", "bottom", or "multiple") |
• | parentedge ("right", "left", "top", "bottom") |
• | partition (returns "vertical" or "horizontal") |
Properties for Connector Shape Scripts
• | addin (value returned from an Add-In) |
• | diagram.connectornotation |
• | rotationdirection ("up", "down", "left", "right") |
• | source.element.stereotype |
• | source.multiplicityisordered |
• | target.element.stereotype |
• | target.multiplicityisordered |
Learn more
The material ("material" includes all pages, documents and on-line graphics) on this web site is protected by copyright law. (C) 1998-2011 Sparx Systems Pty Ltd.