Volume 1 Chapter 7 The CSD Reference Molecules and the Extended Crystal Structure
Ex.1 Suppose we wish to find all intermolecular contacts between a carbonyl oxygen and the hydrogen of an NH group in peptide structures.
We will consider the two groups to be in contact when the O-H distance is less than 3.1Å.

Select or type atoms for CONTACT. If necessary reselect CONTACT to end input. Select CANCEL to cancel command.
Type 1,2, or 3 to indicate type of contact: 1 = INTRA-molecular contacts 2 = INTER-molecular contacts 3 = ANY (ie, either INTRA or INTER-molecular contacts) [Default = 3]
By default, a Van der Waals distance search will be used for this CONTACT. To over-ride it with a minimum and maximum distance, enter the MIN. and MAX. distances, separated by spaces or commas. Otherwise, press <RETURN>.
In the summary area we now have the line:
INTER 2 A 4 A 0.0 3.1
This line is displayed in blue to indicate that it is a non-bonded command.
In the dialogue area we now have the "home" prompt:
Search for ALL crystal fragments OVERLAP of crystal fragments permitted Select a menu command or TO-BUILD to return to the BUILD menu.

Note that there are two separate fragments on the screen - the line between the H and O is not a bond but merely indicates that we have defined a contact between these two atoms. Whenever a CONTACT command is used there must be at least two fragments on the screen. No CONTACT commands are allowed between atoms in the same fragment.
An example of a hit, AAGAGG10, registered by this search is shown below.

Although a CONTACT command cannot accept two sets of atoms from the same fragment that does not mean we cannot search for intramolecular contacts. To conduct the same search again, but for intramolecular contacts, we proceed as follows:
Ex.2
Select or type atoms for CONTACT. If necessary reselect CONTACT to end input. Select CANCEL to cancel command.
Type 1,2, or 3 to indicate type of contact: 1 = INTRA-molecular contacts 2 = INTER-molecular contacts 3 = ANY (ie, either INTRA or INTER-molecular contacts) [Default = 3]
For "INTRA" and "ANY" searches, you must specify the minimum and maximum number of bonds allowed in the shortest path between INTRAMOLECULAR contact atoms. Enter MIN. and MAX. numbers of bonds, separated by spaces or commas [4 999]
By default, a Van der Waals distance search will be used for this CONTACT. To over-ride it with a minimum and maximum distance, enter the MIN. and MAX. distances, separated by spaces or commas. Otherwise, press <RETURN>.
In the summary area we now have the line:
INTRA 1 999 2 A 4 A 0.0 3.1
This line is displayed in blue to indicate that it is a non-bonded command.
In the dialogue area we now have the "home" prompt:
Search for ALL crystal fragments OVERLAP of crystal fragments permitted Select a menu command or TO-BUILD to return to the BUILD menu.
The resultant command in the instruction document is:

A new question has appeared, asking about the shortest bond path between the two atoms. By giving the values 1 999 as the endpoints of the allowed range, this option has been "turned off". Examination of the results reveals that some "hydrogen bonds" within amide groups were located. These atoms satisfy the distance criteria but only because the two groups are chemically adjacent. The shortest bond path option provides a way to avoid these unwanted results.
Ex. 3 If the search is conducted again with:
CONTACT INTRA 5 999 2 A 4 A 0.0 3.1
the desired result is obtained, as shown below.

Finally, it is possible to conduct non-bonded searches that accept both intramolecular and intermolecular contacts.
Ex. 4 If the command is altered to
CONTACT ANY 5 999 2 A 4 A 0.0 3.1
all hydrogen bonds are located. Note that the shortest bond path range must still be given in case any intramolecular contacts are encountered. The results of the search are shown below.

Volume 1 Chapter 7 Using van der Waals Radii for Distance Testing.