result1 = arcpy.GetCount_management("TempSelection") affectedFeatures = int(result1.GetOutput(0))
...code before sub_folder = "ArcToolbox/Toolboxes/" install_dir = arcpy.GetInstallInfo()['InstallDir'].replace("\\","/") tbx_home = os.path.join(install_dir, sub_folder) ...code after
Hmm. Odd. I assume that must have come out of model builder at some point as that is how we originally started our scripting. I've always assumed it was needed. I'll test without thanks.
G
So far, I have also needed to change the path to any toolboxes I've loaded. For example...
from:
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
to:
gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
Am I doing something I don't need to? This was originally a script back at 9.1 or 9.2 that imported win32com.client. Do we no longer need to call out a specific toolbox?
Thanks, Gavin