Author Topic: Where is backfill color stored in EA?  (Read 3606 times)

Woody

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Where is backfill color stored in EA?
« on: June 12, 2010, 08:06:24 am »
I have been asked to programmatically check our diagrams in an EA model to ensure all classes from one of six sub-packages have the same color in all diagrams in which they appear. I am stuck on figuring out how the background fill color is set. I am using the Repository.SQLQuery method to query EA in the vbscript code.

From what I can figure out: t_diagramobject.objectstyle (table.fieldname) has a string value where "BCol=" seems to set the background color if the t_object.backcolor is not set.

I have found t_object.backcolor can be -1 and t_diagramobject.objectstyle can be BCol=-1 at the same time.   I did not find anything in t_diagram.StyleEx that looks like a color code; hex or decimal.

So where is the color being inherited from?

Is there another programmatic way to get at the color of an diagram object?

smendonc

  • EA User
  • **
  • Posts: 148
  • Karma: +5/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Where is backfill color stored in EA?
« Reply #1 on: June 28, 2010, 04:01:57 am »
Search the help for Element.SetAppearance and look at the details for this method.  It allows you to change the background color, font color, border color and border width and also to set if the change is diagram local or applicable to the element appearance in all diagrams.  The last parameter in the call had me stumped when I originally looked at it (its related to the many different color dialogs used in EA).  This parameter comes from the System.Drawing.ColorTranslator class that's part of .net (it's actually an ole class but I've been using .net for my work).  Below is a snippet I used.

element.SetAppearance(1, 0, ColorTranslator.ToOle((fillColor));

Stan.