We prove a version of the Erdős--Beck Theorem from discrete geometry for fractal sets in all dimensions. More precisely, let X⊂Rn Borel and k∈[0,n−1] be an integer. Let dim(X∖H)=dimX for every k-dimensional hyperplane H∈A(n,k), and let L(X) be the set of lines that contain at least two distinct points of X. Then, a recent result of Ren shows
$$ \dim \mathcal{L}(X) \geq \min \{2 \dim X, 2k\}.
$$
If we instead have that X is not a subset of any k-plane, and
$$
0<\inf_{H \in \mathcal{A}(n,k)} \dim (X \setminus H) = t < \dim X,
$$
we instead obtain the bound
$$ \dim \mathcal{L}(X) \geq \dim X + t.
$Wethenstrengthenthislowerboundbyintroducingthenotionofthe"trappingnumber"ofaset,T(X), and obtain \[ \dim \mathcal L(X) \geq \max\{\dim X + t, \min\{2\dim X, 2(T(X)-1)\}\}, \] as consequence of our main result and of Ren's result in \mathbb{R}^n.Finally,weintroduceaconjecturedequalityforthedimensionofthelineset\mathcal{L}(X)$, which would in particular imply our results if proven to be true.