If you install new cabinets, the template can only be done once all the relevant cabinets are in place and levelled.  If you have new countertops fitted over existing cabinetry, most new tops can be measured with the existing surfaces.                 

However, all appliances, the sink, and the plumbing fixtures need to be on location when the measuring is done.