First select the ‘Pen Tool (P)’ from the ‘Toolbar’.

Then up on the ‘Options Bar’ choose the ‘Paths’ option.

Then with the ‘Pen Tool’ still selected trace the area that you want to mask (ie. protect), in this case its the entire building. As you can see below the solid pen outline and the solid anchors points are traced along the edged of the building.

Once you’ve connected the anchor points to create a path, go to ‘Layer/Add Vector Mask/Current Path’ as I have captured below.

Or alternatively, right-click (Mac: Command + click) and choose ‘Create Vector Mask’ as I have captured below.

This will protect whats inside the path and knockout whats external to that path, as you can see below.

Tips:

  1. Go to the ‘Paths Palette’ and you will see that saved path in the list,
  2. the ‘Vector Mask’ remains separate from the original image as indicated by the adjacent ‘Vector Thumbnail’ in the ‘Layers Palette’.
  3. The mask is adjustable, meaning using any of the ‘Path Selection Tool’ / ‘Direct Selection Tools (A)’ and or the ‘Pen Tool (P)’ and subsequent sub tools to modify all ‘Anchor Points’ or any single ‘Anchor Point’.
  4. ‘Adjustment Layers’ and ‘Filters’ can also be applied.
  5. ‘Layer Masks’ and ‘Blending Styles’ can also be applied.
  6. Right-click (Mac: Command + click) on the ‘Vector Mask Thumbnail’ in the ‘Layers Palette’ allows to ‘Delete/Disable/Rasterize Vector Mask’.
    (Also found under the ‘Layer’ menu item.
  7. ‘Rasterize Vector Mask’ turns it into a ‘Layer Mask’ enabling the Paint Brush Tool to ‘Hide/Reveal’ sections of your mask. (Black = Hides/ White = Reveals) But then you loose the ‘Pen Tool’ option that is only available with the ‘Vector Mask’)
  8. Combine a ‘Layer Mask’ with a ‘Vector Mask’ will enable both the ‘Brush/Pencil Tool’ and ‘Pen Tool (P)’ features.
  9. To automatically start with a ‘Vector Mask’ in the ‘Layers Palette’ hold the ‘Ctrl’ (Mac ‘Command’) key as you click the ‘Add Layer Mask’ icon at the bottom of the ‘Layers Palette’. Then use the ‘Pen Tool’ to mask the required area.
  10. ‘Vector Mask’ also enables the use of the ‘Shape Tools (U)’ and its ‘Option Bar’ features.