Is there a way to tell programatically (from the command line) what format a given ArcMap toolbox was saved in - 10.0, 10.1 and so on?
1 Answer 1
I think the short answer is NO. In arcpy you would typically "Describe" an object to get a handle on its properties. It appears there is no way within arcpy to find out the version the toolbox was saved in. If anyone knows of a way then please shoot me down in flames so I can learn from your wisdom!
But you could fudge it this way:
In ArcCatalog right click on the toolbox and go to properties. In the Description write a description of your toolbox and then right at the end write something like "[Version_10_1]" to indicate its a 10.1 toolbox.
In you python code you could then use something like:
obj = arcpy.AddToolbox("C:/temp/testbox.tbx")
description = arcpy.Usage(obj)
if "[Version_10_1]" in description:
print "10.1 toolbox loaded"
-
Nice idea, alas doesn't work for me. My problem is that I keep releasing 10.1 toolboxes by mistake because they save to 10.1 by default when I change them. 10.0 users obviously have problems with this :( I was hoping to add a step to my build script that checked all the toolboxes were 10.0, shame if it's not possible.Sideshow Bob– Sideshow Bob2013年12月02日 10:30:39 +00:00Commented Dec 2, 2013 at 10:30
-
1
-
:) Of course there is a way... install arcgis 10.0 inside a virtual machine and have my build script test it on that machine. Alas this is way beyond my budget!Sideshow Bob– Sideshow Bob2013年12月05日 13:15:06 +00:00Commented Dec 5, 2013 at 13:15