Sergio
Sergio

Reputation: 63

Reading Default Appearance of an EnterpriseArchitect Element by script

the EA API provides the Element.setAppearance() method for setting the default appearance of an element in diagrams; the Style attribute, for the corresponding diagramObjects, is readable&writable. But what about getting the default appearance of an element, since there is no getAppearance() method on Element? Thanks !

Upvotes: 2

Views: 109

Answers (1)

qwerty_so
qwerty_so

Reputation: 36333

You need to get used to the "API" of EA. The back door is the main entrance :-/

Repository.SQLQuery("SELECT Backcolor, Bordercolor, BorderStyle, BorderStyle FROM t_object WHERE ea_guid = '{2C80CA03-DF98-433e-8C32-1EABB4957133}'")

(You need to use the element's GUID instead of the sample)

This will return the numeric values of the columns in an XML string (see EA's help about SQLQuery or just look at the string returned):

<?xml version="1.0"?>
<EADATA version="1.0" exporter="Enterprise Architect">
<Dataset_0><Data><Row><Backcolor>1993170</Backcolor><Bordercolor>-1</Bordercolor><Expr1002>0</Expr1002><BorderStyle>0</BorderStyle></Row></Data></Dataset_0></EADATA>

Upvotes: 1

Related Questions