How can I Change color via GlobalTable

How can I Change color via GlobalTable

mMLLPP772DMH3B
Enthusiast Enthusiast
1,410 Views
4 Replies
Message 1 of 5

How can I Change color via GlobalTable

mMLLPP772DMH3B
Enthusiast
Enthusiast

[ FlexSim 20.1.3 ]

Hi,

I want to change the item color. I used triggers (set color by case) to change item color, but I wondering if I can use GlobalTable to set it when I have hundreds of item.


Thank you for your advance.

1659498017402.png1659498031287.png


0 Likes
Accepted solutions (1)
1,411 Views
4 Replies
Replies (4)
Message 2 of 5

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

Do you want to choose the specific color for each type? If not, you can use 'Color.byNumber()' to assign a different color to each item type.

1659507070998.pngTo assign specific colors I would suggest to set up a color palette.

1659507044569.png

When using a global table you would have to enter the RGB values for the each color (0-1 for each component) and read them in the trigger.

1659507348504.png

0 Likes
Message 3 of 5

mMLLPP772DMH3B
Enthusiast
Enthusiast

@Felix Möhlmann thanks for your response


I want to use the global table to specify the color of each label.

For example like Type101 I want it to be painted grey, Type200 I want it to be painted black, can I use a table to manage hundreds of product type with one Table?

The reason I want to do this is that if I want to make changes to the product, I can make changes directly to the table. It"s more flexible.


Thank again~ 🙂

0 Likes
Message 4 of 5

FelixMoehlmann
Collaborator
Collaborator

If you set the data type of the global table column to 'FlexScript', you can type in the color like you do in the trigger and then evaluate that cell to return the color value.

1659516061821.png

1659515943960.png

As I said above though, you can do essentially the same with a color palette (assign a color to each possible label value). The palette also allows you to customize the colors instead of just choosing from the 16 (?) pre-defined ones.

0 Likes
Message 5 of 5

andrew_o2
Not applicable

Hi @Wei_cheng Chiu, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes