Skip to content

Instantly share code, notes, and snippets.

@erochest
Created November 16, 2011 17:45
Show Gist options
  • Save erochest/1370788 to your computer and use it in GitHub Desktop.
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..
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