This week’s Friday Tip will show you how to change the image of a work item based on a label value. This is really great for showing different types of work or if you just want to add in some random variety; for example if your work items are people, you may want them to all look different.
Reserved Label Image
SIMUL8 has several reserved label names which are used automatically by SIMUL8. Image: is one of these reserved labels. Image: as its name suggests lets you change the image of a work item.
How it works
If a work item has a numeric label with a name beginning Image: and that label is listed in a work center’s or work entry point’s label actions then SIMUL8 will take the rest of the labels name and add it to the label’s value and look for an image with that name.
How to create the model
- Create 3 images called ball1, ball2, ball3
- Create a numeric label called Image:ball
- In label actions for the work entry point set Image:ball to a rounded uniform distribution with values 1 to 3.
Please note that in all cases, the image button in the work center’s graphics dialog has priority over any changes to images made via labels.
What else would you like to learn about labels?