Book a Demo

Author Topic: How to Get Background Color of Diagram Object  (Read 4995 times)

Sekerci

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
How to Get Background Color of Diagram Object
« on: June 12, 2015, 08:23:48 pm »
I want to export diagram to Visio file and I need background color of diagram objects using c# program which is not add-in.

As far as I know, the only place for background color is "BCol" value in style string. But, "BCol" values are always "-1" for diagram objects.

I can get diagram objects, elements for objects, sizes of objects, that's all. If it s possible, I would get line style of boxes (dash, dot, solid,...), line widths.

Thanks in advance.

Birol

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to Get Background Color of Diagram Object
« Reply #1 on: June 13, 2015, 01:39:58 am »
-1 means it's the default. Those values are stored in the registry. You need to export/change/export 2nd/compare to find out which one is the relevant.

q.

cjcrystal

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: How to Get Background Color of Diagram Object
« Reply #2 on: August 11, 2017, 04:15:04 pm »
hi qwerty, when i do an export on the Template Package , i can see a value "Backcolor=

is this what you mean is being stored in Registery ,and not in t_objectproperties ?


<UML:ModelElement.stereotype>
                     <UML:Stereotype name="StartEvent"/>
                     </UML:ModelElement.stereotype>
                     <UML:ModelElement.taggedValue>
                        <UML:TaggedValue tag="isAbstract" value="false"/>
                        <UML:TaggedValue tag="isSpecification" value="false"/>
                        <UML:TaggedValue tag="ea_stype" value="Event"/>
                        <UML:TaggedValue tag="ea_ntype" value="0"/>
                        <UML:TaggedValue tag="version" value="1.0"/>
                        <UML:TaggedValue tag="isActive" value="false"/>
                        <UML:TaggedValue tag="package" value="EAPK_444566AF_65F1_487b_9054_F3ADA21DEEF4"/>
                        <UML:TaggedValue tag="date_created" value="2017-03-22 15:58:04"/>
                        <UML:TaggedValue tag="date_modified" value="2017-05-08 15:41:36"/>
                        <UML:TaggedValue tag="gentype" value="&lt;none&gt;"/>
                        <UML:TaggedValue tag="tagged" value="0"/>
                        <UML:TaggedValue tag="package_name" value="Template Package"/>
                        <UML:TaggedValue tag="phase" value="1.0"/>
                        <UML:TaggedValue tag="complexity" value="1"/>
                        <UML:TaggedValue tag="status" value="Proposed"/>
                        <UML:TaggedValue tag="stereotype" value="StartEvent"/>
                        <UML:TaggedValue tag="tpos" value="0"/>
                        <UML:TaggedValue tag="ea_localid" value="121"/>
                        <UML:TaggedValue tag="ea_eleType" value="element"/>
                        <UML:TaggedValue tag="style"         value="BackColor=5756588;BorderColor=32768;BorderWidth=1;FontColor=-1;VSwimLanes=1;HSwimLanes=1;BorderStyle=0;"/>

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to Get Background Color of Diagram Object
« Reply #3 on: August 11, 2017, 06:07:22 pm »
I probably got mistaken here (too long ago). The registry holds the painter background color values. Of course your export shows the color which is used for the element. Sorry for the confusion.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How to Get Background Color of Diagram Object
« Reply #4 on: August 14, 2017, 08:28:52 am »
Looks like you've set the object default colour, not the diagram local colour. That will be retrieved directly from the Element class.