We now combine the ladder network with the circuit in inset B. All but one of the grounds in the ladder network is connected via switches either to a real ground or to the virtual ground of the operational amplifier circuit. Here's a drawing.

As far as the R/2R ladder is concerned, the operational amplifier circuit isn't even there. Either the points that were formerly grounded still are (the switches S1, S2, and S3 switched to the left) or they're connected to virtual ground (one or more of the switches switched to the right). Thus, the potentials we computed previously are unchanged. What happens to V_{out} as the switches are switched? V_{out} = -I_{in} R, but I_{in} comes from whichever branches of the resistive ladder are switched to the right.