  Let $K$ be a number field of degree $d$. Then every ideal $I$ in the ring of
integers ${\mathcal O}_K$ contains infinitely many primitive elements, i.e.
elements of degree $d$. A bound on smallest height of such an element in $I$
follows from some recent developments in the direction of a 1998 conjecture of
W. Ruppert. We prove a very explicit bound like this in the case of quadratic
fields. Further, we consider primitive elements in an ideal outside of a finite
union of other ideals and prove a bound on the height of a smallest such
element. Our main tool is a result on points of small norm in a lattice outside
of an algebraic hypersurface and a finite union of sublattices of finite index,
which we prove by blending two previous Diophantine avoidance results. We also
obtain an avoidance result like this for lattice points in the positive orthant
in $\mathbb{R}^d$ and use it to obtain a small-height totally positive
primitive element in an ideal of a totally real number field outside of a
finite union of other ideals. Additionally, we use our avoidance method to
prove a bound on the Mahler measure of a generating non-sparse polynomial for a
given number field. Finally, we produce a bound on the height of a smallest
primitive generator for a principal ideal in a quadratic number field.
