Author Topic: Shapescript. Color definition  (Read 716 times)

Alex9329

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Shapescript. Color definition
« on: December 15, 2017, 02:50:13 am »
Hi,

I have created a non-UML element type. In shape script I entered drawparentshape(). But in doesn't inherit the color of the parent element. (I have chosen Archimate Application Interaction - the color must be 0;255;255). I have tried setfillcolor() but it doesn't work. How to change the color, keeping drawparentshape()

Alex9329

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Shapescript. Color definition
« Reply #1 on: December 15, 2017, 03:23:37 am »
Moreover. If I try to change the color of the created elements for which I have used "drawparentshape" and can not change the colors for these elements on diagrams (right button - appearance - default appearance). I want to select different colors on diagrams, no matter what color I have chosen in shape script. The color in shapescripts should be default but I want have a chance to change it. How to do it?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shapescript. Color definition
« Reply #2 on: December 15, 2017, 03:36:51 am »
You should not set the color in the schapescript, but change the color of the stereotype item on the profile diagram.
Then make sure the option to take the colors is checked when exporting your UML profile. (don't know exactly how that option is called)

Geert

Alex9329

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Shapescript. Color definition
« Reply #3 on: December 15, 2017, 03:51:13 am »
I have tried but it doesn't work....

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller

Alex9329

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Shapescript. Color definition
« Reply #5 on: December 15, 2017, 05:14:20 pm »
Ok, I got the point. It works when I create a stereotype right from the UML element.
But if I make such structure: UML metaclass element - existing non-UML stereotype - "custom new stereotype". In this "custom new stereotype" in shape scripts I write "drawparentshape()". If I write it the default appearance changes don't work. I want it to work with  "drawparentshape()"
« Last Edit: December 15, 2017, 05:23:53 pm by Alex9329 »

qwerty

  • EA Guru
  • *****
  • Posts: 9433
  • Karma: +150/-138
  • I'm no guru at all
    • View Profile
Re: Shapescript. Color definition
« Reply #6 on: December 15, 2017, 07:09:11 pm »
I guess it might be worth sending a bug report.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shapescript. Color definition
« Reply #7 on: December 15, 2017, 09:09:51 pm »
I'm not sure if it has anything to do with the DrawParentShape() itself. Might be a problem with the archimate shapescript.
As we know these aren't the best written shapescripts ever. (the ones from BPMN are much much better)

Geert

Alex9329

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Shapescript. Color definition
« Reply #8 on: December 15, 2017, 09:19:33 pm »
Thanks. Also I have another question. I would like to choose the value of the tagged value of the element and the color of the element should be changed based on the tagged value meaning. How to do it in shape scripts?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shapescript. Color definition
« Reply #9 on: December 15, 2017, 09:25:03 pm »
use something like
Code: [Select]
     if (HasTag ("Trigger", "None"))
     {
               //set color here
     }

Geert