You can retrieve the postion of a part or a product with the Get Postion activity programmed in SFC+.
Open the sample created in the Set Displacement in SFC+ user task. The activity Set Displacement defined in the Simulation Logic of the resource allows the user to move the button cap while playing the simulation.

Select the Main block and double-click Behavior
in the Main window.

- The SFC+ Editor appears as an immersive window at the center of the screen.
- A toolbox containing all the SFC+ Editor commands appears at the right side of the screen.
Select Get Position
in the Activities toolbar.
If the immersive window is in front of the part, click in the 3D view.
The SFC+ Editor window becomes transparent.
Now, you can click through the editor window.
Select the
part being the target of the activity.
The selected part is highlighted and a bubble appears.

Click the bubble to confirm the part selection.
The
Get Position Properties dialog box appears.

In the Displacement frame, you can enter the name of ports or local signals containing the target position.
In the Action Data frame, you can define:
In the Declaration frame, you can define that the ports or signals used in the Position frame must be created with the activity. This must be done if the ports or signals are not already defined in the block.
Select Detailed.
Enter a port name in the AlongZ box.

Note:
You can enter any port or local signal compliant with the Float64 type.
Click As Port in the Declaration frame.
So, the OutZ port will be created with the activity.
Click Sustain in the Action frame.
So, the Get Position activity will be run at each simulation step.
Click OK and select the Step S0 in the SFC+ Editor window
A new action is added to step S0. The action contains an icon identifying the activity Get Position followed by the name of the product being the target of the activity.

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.
- Click Next
in the control bar of the compass.

OutZ returns the Z position of the button cap.
- Force the value of State to 10. That means that the "Lighted Round Push Button Led" part is going to move to 10mm.
- Press Enter.

- Click Next
in the control bar of the compass.

The device moves along the Z
axis. Because of a one cycle delay, the value OutZ does not change.

- Click Next
again. The value of OutZ is updated.

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