A $ 3\times3\times3$ cube composed of $ 27$ unit cubes rests on a horizontal plane. Determine the number of ways of selecting two distinct unit cubes from a $ 3\times3\times1$ block (the order is irrelevant) with the property that the line joining the centers of the two cubes makes a $ 45^\circ$ angle with the horizontal plane.
1. **Understanding the Problem:**
   We need to determine the number of ways to select two distinct unit cubes from a \(3 \times 3 \times 1\) block such that the line joining the centers of the two cubes makes a \(45^\circ\) angle with the horizontal plane.

2. **Visualizing the \(3 \times 3 \times 1\) Block:**
   A \(3 \times 3 \times 1\) block is essentially a flat layer of 9 unit cubes arranged in a \(3 \times 3\) grid. Each unit cube has coordinates \((x, y, z)\) where \(x, y \in \{1, 2, 3\}\) and \(z\) is fixed.

3. **Condition for \(45^\circ\) Angle:**
   For the line joining the centers of two cubes to make a \(45^\circ\) angle with the horizontal plane, the vertical distance (along the \(z\)-axis) between the two cubes must be equal to the horizontal distance (in the \(xy\)-plane).

4. **Possible Pairs:**
   Since the \(z\)-coordinate is fixed, the vertical distance is zero. Therefore, the problem is interpreted as finding pairs of cubes in the \(xy\)-plane such that the line joining their centers makes a \(45^\circ\) angle with the horizontal plane. This means the horizontal distance between the cubes must be \(\sqrt{2}\) units (diagonal of a unit square).

5. **Identifying Valid Pairs:**
   In a \(3 \times 3\) grid, the valid pairs of cubes that are \(\sqrt{2}\) units apart (diagonally adjacent) are:
   - \((1,1)\) and \((2,2)\)
   - \((1,1)\) and \((2,0)\)
   - \((1,2)\) and \((2,1)\)
   - \((1,2)\) and \((2,3)\)
   - \((2,1)\) and \((3,2)\)
   - \((2,1)\) and \((1,0)\)
   - \((2,2)\) and \((3,3)\)
   - \((2,2)\) and \((1,1)\)
   - \((2,3)\) and \((3,2)\)
   - \((2,3)\) and \((1,2)\)

   Each pair is counted twice, so we have 10 unique pairs per \(3 \times 3 \times 1\) block.

6. **Counting All Possible Blocks:**
   There are 3 possible \(3 \times 3 \times 1\) blocks in the \(3 \times 3 \times 3\) cube (one for each layer along the \(z\)-axis).

7. **Total Number of Ways:**
   Since each block has 10 valid pairs and there are 3 such blocks, the total number of ways is:
   \[
   10 \times 3 = 30
   \]

The final answer is \(\boxed{30}\)