Rickey
Rickey

Reputation: 71

Retrieve colour of diagram from sparx systems enterprise architect

enter image description here

Consider a below Image that is drawn in sparx systems enterprise architect tool is there any way to get the colour of each element like: blue, yellow. I know I cant get from tagged value because I have not mentioned.

Upvotes: 0

Views: 663

Answers (1)

Geert Bellekens
Geert Bellekens

Reputation: 13711

Check EA.DiagramObject.Style

From the help file:

The Style attribute is used for setting the appearance of a DiagramObject; it is set with a string value in the format:

BCol=n;BFol=n;LCol=n;LWth=n;

where:

· BCol = Background Color

· BFol = Font Color

· LCol = Line Color

· LWth = Line Width

The color value is a decimal representation of the hex RGB value, where Red=FF, Green=FF00 and Blue=FF0000

DiagObj.Style = "BCol=35723;BFol=9342520;LCol=9342520;LWth=1;"

The following code snippet shows how you might change the style settings for all of the objects in the current diagram, in this case changing everything to red:

     For Each aDiagObj In aDiag.DiagramObjects

       aDiagObj.Style = "BCol=255;BFol=9342520;LCol=9342520;LWth=1;"

       aDiagObj.Update

       aRepos.ReloadDiagram aDiagObj.DiagramID

     Next

Upvotes: 2

Related Questions