How can a create 2D contacts?

To create a 2D contact the process is:

If 2-noded elements are meshed, later it is easy in the .bas file to list them by pairs.