The circuit produces an output voltage equal to the peak to peak value of the AC input voltage.
When the switch is thrown to GROUND, the input voltage swings symmetrically from GROUND. The circuit in this case is also a voltage doubler.
When the switch is thrown to the DC voltage, the input voltage will swing asymmetrically with respect to GROUND. This, however, does not alter the peak to peak value of the AC input signal so the output voltage is the same as when the switch is at the other position.
Sakotai says: