Here, again, is our program:



We use PostRequestMessage to send the data item GetName (note data items are case-sensitive), and ZEMAX's response is stored in the string szBuffer. We then print szBuffer in a standard Windows Message Box:

 

So, we have successfully retrieved data from ZEMAX. We then send the data item SetField (see documentation) to set field point 3 to be x= 20, y=20, weight=1, all vignetting factors = 0. In this case, ZEMAX responds with the updated settings of field point 3:



to show that execution was successful. BUT, this change is made to a copy of the lens file. In order to see this change via the user interafce, we must "push" the updated file to the user interafce. We do this with the third command, PushLens, 1 (the ,1 also updates all open analysis windows). As a consequence, the field dialog now shows:



So to tell ZEMAX to perform an action we just send the relevant data item, but to see the consequences of that action in the normal user interface we must also send a PushLens command.