OK. that worked too, without loading the toolbox, an shaved about 8 seconds off the process (34secs to 26 seconds for the script), so I'll going to switch the "correct answer" to the above although it is all very help ful and there is of course more than one way to handle it.
So, instead of my code
- myDir = arcpy.GetInstallInfo()["InstallDir"]
- toolboxPath = arcpy.os.path.join(myDir, "ArcToolbox\Toolboxes\Spatial Analyst Tools.tbx")
- arcpy.AddMessage("toolbox {}".format(toolboxPath))
- arcpy.AddToolbox(toolboxPath)
- #...
arcpy.ExtractValuesToPoints_sa(randomTemp, elevRaster, randomPtSet, "NONE", "VALUE_ONLY")
I'm switching to
import arcpy
from arcpy.sa import *
#...
arcpy.sa.ExtractValuesToPoints(randomTemp, elevRaster, randomPtSet, "NONE", "VALUE_ONLY")
Both work, and the version/path check may come in handy for other things, but the second solution is what I will go with for now.
EDIT: fixed typo in second code block.