For measurement purposes, the threads would be measured across pins on the pitch diameter. For practical purposes measure across the maximum diameter on the threads and round up as they will virtually always be under the nominal. The measurement across the unthreaded portion may be the same or less depending on the design. On stretch bolts it will almost always be less here to control the stretch.