SETNSCPOSITION 1, 4, 3, 115
To get the detector data, you will want to use OPENANALYSISWINDOW and then either EXPORTJPG (to get an image) or GETTEXTFILE (to get the data in text form). You can find a good example of this here: Saving detector series data / img with ZPL | Zemax Community
ZOS-API:
To change the Z-postion, in the ZOS-API, you would call something like this (for more information on the command, check out the ZOS-API Help File):
TheSystem.NCE.GetObjectAt(4).ZPosition = 115;
For the detector data, this is a little more involved as I mentioned, but there is a detailed explanation here: Methods for extracting detector data through the API | Zemax Community.