You can program a Set Displacement activity in SFC+.
Open a resource that has sub-products (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 block behavior is undefined, so the window is empty.
Select Set Displacement
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 move.
The selected part is highlighted and a bubble attached to it appears.

Click the bubble to confirm the part selection.
The
Set Displacement Properties dialog box appears.

In the Displacement frame, you can define the displacement vector of the product.
In the Action Data frame, you can define:
Select Detailed.
Enter a port name for AboutW.

Note:
You can enter any port or local signal name compliant with the Float64 type.
Select As Port in the Declaration frame.
So, the State port will be created with the activity.
Click in the SFC+ Editor to position a new step.
A first
step of the SFC+ graph is created. The action contains an icon identifying the activity Set Position followed by the name of the product (or the part) being the target of the activity.

Scroll over the action to see the parameters.

Close the SFC+ Editor window.
To test the behavior of the activity in simulation:
- Select the Main block in the Simulation Logic tree and click Play
in the compass. The block is compiled and the simulation is initialized. The Simulation toolbar and the Signals Monitoring window appear.
- Expand the Ports node of the Signals Monitoring window and force the value of State to 10. The part will move to 10 mm along the W axis.

Note:
Only the value of the signal emitted (AlongW in our example) is taken into account by the simulation. The other signals keep their current value.
- Press Enter.
- Click Next
in the control bar of the compass. The device moves along the Z
axis.

- Click the Play of the compass to close the simulation.