描画スクリプトで表示する要素内では、要素や接続・ダイアグラムに関するいくつかのプロパティの内容を参照したり、文字列として表示したりできます。
 
文字列を表示するためには、以下のいずれかのコマンドを利用します。
 
これらのいずれも、引数として表示する文字列を渡します。この場合に、置換マクロ#propertyname#を利用することで、要素などのプロパティの内容を出力できます。
 
例: println("name: #NAME#");
 
複数の内容を出力したい場合には、これらのコマンドを複数回利用することになります。出力可能な要素や接続のプロパティは、このページ下部の一覧をご覧ください。下の一覧の項目の他に、タグ付き値の値を表示できます。タグ付き値の名前の前にTAG:という文字をつけて下さい。
 
例: print("#TAG:condition#");
 
同様の方法で、要素のカスタムプロパティの確認と表示も可能です。
 
例: if(hasproperty("Name","Value"))
               ...
   print("#Name#");
 
「描画スクリプトのサンプル」のページにて、利用した例を紹介しています。
 
そのほか、HasPropertyを利用して、値に応じて処理を分岐できます。下記のプロパティの中で、真偽値を持つものは"true"あるいは"false"と比較してください。
 
 
描画スクリプトで利用可能なプロパティ
 
要素のプロパティ
- actualname - 「別名で表示」の設定にかかわらず、常に「名前」を返します。
 - addin - アドインを呼び出してその戻り値を利用します。
 
   文法: addin:<アドイン名>, <メソッド名>, <パラメータ> [, <パラメータ> ...]
   なお、hasproperty()の引数で利用する場合には、#の記号で囲むことが必要です。
   例: if(hasproperty("#ADDIN:MyAddin,MyValue#", "TheValue")) { 
- alias 
 - author
 - bookmark
 - bookmarkvalue
 - cardinality 
 - classifier
 - classifier.actualname -  「別名で表示」の設定にかかわらず、常に「名前」を返します。
 - classifier.alias
 - classifier.metatype
 - classifier.name
 - classifier.stereotype
 - classifier.type
 - complexity
 - concurrency
 - datecreated
 - datemodified
 - ES - ステレオタイプを示す<<と>>のうち、右側の>>を示す文字です。
 - haslinkeddocument
 - hiddenparents -  汎化で結ばれる親要素のうち、対象のダイアグラムに配置されていない要素名。複数の場合は改行で区切られます。
 
- incomingedge ("none", "left", "right", "top", "bottom", "multiple")
 
- isabstract
 - isactive
 - iscomposite
 - isdrawcompositelinkicon
 - isembedded
 - isinparent
 - isleaf
 - islocked
 - isroot
 - isspec
 - istagged
 - isvisible
 - keywords
 - language
 - metatype
 - multiplicity
 - name
 - notes
 - notesvisible
 
- outgoingedge ("none", "left", "right", "top", "bottom", "multiple")
 - packagename
 - packagepath
 - package.stereotype
 - parentedge ("Right", "Left", "Top", "Bottom")
 - parent.metatype
 - partition ("horizontal", "vertical")
 - persistence
 - phase
 - priority
 - propertytype
 - propertytype.alias
 - propertytype.metatype
 - propertytype.name
 - propertytype.stereotype
 - qualifiedname
 - rectanglenotation
 - scope
 - showcomposeddiagram
 - SS - ステレオタイプを示す<<と>>のうち、左側の<<を示す文字です。)
 - status
 - stereotype
 - stereotypehidden
 - subtype
 - type
 - version
 - visibility
 
 
 
接続のプロパティ
- actualname - 別名の利用が指定されている場合でも、常に名前を返します。
 - addin - アドインを呼び出してその戻り値を利用します。
 
   文法: addin:<アドイン名>, <メソッド名>, <パラメータ> [, <パラメータ> ...]
   なお、hasproperty()の引数で利用する場合には、#の記号で囲むことが必要です。
   例: if(hasproperty("#ADDIN:MyAddin,MyValue#", "TheValue")) { 
- alias
 - direction
 - effect
 - ES - ステレオタイプを示す<<と>>のうち、右側の>>を示す文字です。
 - guard
 - isroot
 - isleaf
 - name
 - rotationdirection ("up", "down", "left", "right") 
 - source.actualname - 「別名で表示」の設定にかかわらず、常に「名前」を返します。
 - source.aggregation
 - source.alias
 - source.changeable
 - source.constraints
 - source.element.name
 - source.element.stereotype
 - source.metatype
 - source.metatype.general
 - source.metatype.specific
 - source.metatype.both
 - source.multiplicity
 - source.multiplicityisordered
 - source.name
 - source.qualifiers
 - source.rectanglenotation
 - source.stereotype
 - source.targetscope
 - SS - ステレオタイプを示す<<と>>のうち、左側の<<を示す文字です。
 - stereotype
 - target.actualname - 「別名で表示」の設定にかかわらず、常に「名前」を返します。
 - target.aggregation
 - target.alias
 - target.changeable
 - target.constraints
 - target.element.name
 - target.element.stereotype
 - target.metatype
 - target.metatype.general
 - target.metatype.specific
 - target.metatype.both
 - target.multiplicity
 - target.multiplicityisordered
 - target.name
 - target.qualifiers
 - target.rectanglenotation
 - target.stereotype
 - target.targetscope
 - triggers
 - type
 - weight
 
 
 
ダイアグラムのプロパティ
- diagram.author
 - diagram.handdrawn
 - diagram.mdgtype
 - diagram.mdgview
 - diagram.name 
 - diagram.stereotype 
 - diagram.type 
 - diagram.version
 
 
アドインの呼び方
描画スクリプトから、アドインのメソッドを呼び出してその戻り値を表示情報に利用できます。
 
print("#ADDIN:アドイン名, メソッド名, 引数1, 引数2,...#");
のような形で利用します。具体例は以下の通りです。
print("#ADDIN:CS_AddinFramework, GetValueForShape, Stereotype, Alias#");
 
呼び出される側は、以下のような宣言になります。(引数は下記の通りで宣言する必要があります。)
 
public string GetValueForShape(EA.Repository Repository, string eaGuid, object theParams)
 
 
参照: