Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: bITs.EA on January 23, 2017, 07:41:57 pm

Title: ShapeScript: users can't change set color
Post by: bITs.EA on January 23, 2017, 07:41:57 pm
Hi

In my shapescript, I want to define a default fill color (eg. setFillColor(255,255,255) ) for my shapes, but my users need to be able to change the colors when they design a model. Is there a way to achieve this with shapescript? Or do I need to use the "default" colors and forget about my default fill color?

Thanks

S
Title: Re: ShapeScript: users can't change set color
Post by: Uffe on January 23, 2017, 10:30:04 pm
Hello,

Try color queries (http://sparxsystems.com/enterprise_architect_user_guide/13.0/modeling_tools/color_queries.html).

/Uffe
Title: Re: ShapeScript: users can't change set color
Post by: bITs.EA on January 23, 2017, 11:09:00 pm
In case of color queries, you depend completely on the users choice and you can't set a default (or can you?).

What I want is :
- Setting a default myself
- Give the user the opportunity to change that color
Title: Re: ShapeScript: users can't change set color
Post by: bITs.EA on January 24, 2017, 12:28:10 am
I found the answer myself:

1) Don't set the color in the ShapeScript
2) Select the stereotype and press "F4" to show the Default Appearance dialog
3) Set the desired default appearance.

--> Now the elements are shown in the default appearance, but the user can change this appearance
Title: Re: ShapeScript: users can't change set color
Post by: Eve on January 24, 2017, 08:18:09 am
What you should do is define the colour(s) associated with your stereotype when you create your profile.

Users can then override your default colours locally (for a single diagram) or as default like the way you are currently doing it (for a single element).