The active template approach to interlocked molecules