The xor button facilitates inverting the polarity of layers, and is available only in physical mode. The operation is similar to the box command, however all previously existing boxes, polygons, and wires on the same layer which overlap the created box become holes in the new box. Only boxes, polygons, and wires are inverted, other structures are covered. When a wire is partially xor'ed, the part of the wire outside of the xor region becomes a polygon. The !layer command can also be used to invert layer polarity, and is recommended when an entire cell is to be inverted.
While the command is active in physical mode, the cursor will snap to horizontal or vertical edges of existing objects in the layout if the edge is on-grid, when within two pixels. When snapped, a small dotted highlight box is displayed. This makes it much easier to create abutting objects when the grid snap spacing is very fine compared with the display scaling. This feature can be controlled from the Edge Snapping group in the Snapping page of the Grid Setup panel.
The box, erase, and xor commands participate in a protocol that is handy on occasion.
Suppose that you want to erase an area, and you have zoomed in and clicked to define the anchor, then zoomed out or panned and clicked to finish the operation. Oops, the box command was active, not erase. One can press Tab to undo the unwanted new box, then press the erase button, and the erase command will have the same anchor point and will be showing the ghost box, so clicking once will finish the erase operation.
The anchor point is remembered, when switching directly between these three commands, and the command being exited is in the state where the anchor point is defined, and the ghost box is being displayed. One needs to press the command button in the side menu to switch commands. If Esc is pressed, or a non-participating command is entered, the anchor point will be lost.