Author Topic: ShapeScript: users can't change set color  (Read 4582 times)

bITs.EA

  • EA User
  • **
  • Posts: 80
  • Karma: +2/-0
    • View Profile
ShapeScript: users can't change set color
« 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

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: ShapeScript: users can't change set color
« Reply #1 on: January 23, 2017, 10:30:04 pm »
Hello,

Try color queries.

/Uffe
My theories are always correct, just apply them to the right reality.

bITs.EA

  • EA User
  • **
  • Posts: 80
  • Karma: +2/-0
    • View Profile
Re: ShapeScript: users can't change set color
« Reply #2 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

bITs.EA

  • EA User
  • **
  • Posts: 80
  • Karma: +2/-0
    • View Profile
Re: ShapeScript: users can't change set color
« Reply #3 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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8054
  • Karma: +118/-20
    • View Profile
Re: ShapeScript: users can't change set color
« Reply #4 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).