Sparx Systems Forum

Discussion => General Board => Topic started by: Alex9329 on December 15, 2017, 02:50:13 am

Title: Shapescript. Color definition
Post by: Alex9329 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()
Title: Re: Shapescript. Color definition
Post by: Alex9329 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?
Title: Re: Shapescript. Color definition
Post by: Geert Bellekens 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
Title: Re: Shapescript. Color definition
Post by: Alex9329 on December 15, 2017, 03:51:13 am
I have tried but it doesn't work....
Title: Re: Shapescript. Color definition
Post by: Geert Bellekens on December 15, 2017, 04:41:04 am
See also http://www.sparxsystems.com/forums/smf/index.php/topic,37772.msg235867.html#msg235867 (http://www.sparxsystems.com/forums/smf/index.php/topic,37772.msg235867.html#msg235867)

Geert
Title: Re: Shapescript. Color definition
Post by: Alex9329 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()"
Title: Re: Shapescript. Color definition
Post by: qwerty on December 15, 2017, 07:09:11 pm
I guess it might be worth sending a bug report.

q.
Title: Re: Shapescript. Color definition
Post by: Geert Bellekens 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
Title: Re: Shapescript. Color definition
Post by: Alex9329 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?
Title: Re: Shapescript. Color definition
Post by: Geert Bellekens on December 15, 2017, 09:25:03 pm
use something like
Code: [Select]
     if (HasTag ("Trigger", "None"))
     {
               //set color here
     }

Geert