Created
November 16, 2011 17:45
-
-
Save erochest/1370788 to your computer and use it in GitHub Desktop.
Exploring calling QuickExport from a Python script tool and passing a Layer object through..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
# Parameter 0, whatever the name, should have type "Feature Layer". | |
obj = arcpy.GetParameter(0) | |
# This prints out all of the properties and methods on the object that gets | |
# passed in as Parameter(0). I haven't looked closely, but we should be able | |
# to pass this directly to | |
arcpy.AddMessage('obj = %r' % (repr(dir(obj)),)) | |
# This gets the parameters that the QuickExport function takes and prints them | |
# out. | |
params = arcpy.GetParameterInfo('QuickExport') | |
arcpy.AddMessage('param count = %d' % len(params)) | |
for param in params: | |
arcpy.AddMessage('Name: %s ; Type: %s ; = %r' % ( | |
param.name, param.parameterType, param.value)) | |
# In IDLE, you can do these commands to get more information. | |
# | |
# import arcpy | |
# help(arcpy.interop) | |
# help(arcpy.interop.QuickExport) | |
# | |
# The last one has some pointers for how we need to format the string | |
# containing the output parameters. Then we can do something like: | |
# | |
# arcpy.interop.QuickExport(obj, '...') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment