You can insert a Set Color action in a SFC+ graph.
Open a resource that has sub-products in the Live Simulation environment (see a typical
example below).

To open the SFC+ Editor, do one of the following:
- Expand the content of the Main block and double-click Behavior.
- Right-click the Main block and select Behavior Editor.
- Select Behavior Editor
in the Main window toolbar.
A 2D immersive window is opened to edit
the block behavior. A toolbox at the right side of the window contains the SFC+ Editor commands.

Note:
In our example, the resource logic is undefined, so the editor is empty.
Select Set Color
in the Activities toolbox.
If the 2D immersive window is in front of the 3D object, click in the 3D view.
The SFC+ Editor window becomes transparent.
Select the
part to position.
The selected part is highlighted and a bubble attached to it appears.

Click the bubble to confirm the selection of the product.

The Color Properties dialog box appears.
To select the color, you can do one of the following:
For our example, select Restore Color.
In the Action frame, you can fill Condition with a boolean expression. Then, the action Set Color is triggered only if the condition is true.
Note:
If you select Sustain, the Set color activity is applied at each step the step is active. This is useful if the color is set by ports and signals and their value changes.
Click OK. Then, click in the SFC+ Editor to position a new step.
A first
step of the SFC+ graph is created. The action contains a square displaying the selected color followed by the name of the product (or the part) being the target of the activity.

Create a new Set color action in the SFC+:
-
Select Set Color
in the Activities toolbox.
- Select the part Green Lens.1 in the 3D view.
-
Click the bubble to confirm the selection of the product.
- Select a color.

- Click OK and click in the SFC+ Editor to position a new step.

Select Add Transition
in the Tools toolbar, click the initial step and then, the second step.

Double-click the transition to change the condition.

Click OK.

The transition appears in red because the signal Power is undefined.
Select the Main block and select Edit Properties in its contextual menu.
The Block Properties dialog box appears.
Click Add port and change the name of the new port to Power.

Click OK.
The transition is no more in red.
Repeat the step 11. and 12. to create a transition between the step S1 and S0. Set the transition condition to Power=false.

Close the SFC+ Editor.
To test the behavior of the activity in simulation:
- Select the Main block and click Play
in the compass. The block is compiled and the simulation is initialized. The Simulation toolbar and the Signals Monitoring window appear.
- Click Next in the control bar of the compass.
As the first action is to restore the original color, the led does not change.

- Expand the Ports node of the Signals Monitoring window and force the value of Power to true.

- Press Enter.
- Click Next in the control bar of the compass.
The led is highlighted by the color change.

- Repeat the step c. and force the value of Power
to false.
- Click Next. The initial color of the led is restored.
- Click the Play of the compass to close the simulation.