AnsweredAssumed Answered

Python Script Error for KML conversion

Question asked by manuesri on May 23, 2016
Latest reply on May 24, 2016 by dkwiens

I tried to run this script for converting a batch of shp files in a folder... But i receive error msg posted below... Kindly suggest...

 

import arcpy

# Set environment settings

arcpy.env.workspace = r"D:\Work\Test"

#Output Path

outKML = r"D:\Work\Test\new"

# Variables Defined

composite = 'NO_COMPOSITE'

pixels = 2048

dpi = 96

clamped = 'CLAMPED_TO_GROUND'

scale = 10000

 

for layer in arcpy.ListFiles():

        arcpy.MakeFeatureLayer_management(layer, Flayer)

        arcpy.LayerToKML_conversion(Flayer, outKML,scale, composite,

                                        '', pixels, dpi, clamped)

else:

        arcpy.AddMessage('There are no layer files in '+arcpy.env.workspace+'.')

 

 

 

 

Error :

Traceback (most recent call last):

  File "D:\Work\Test\Test.py", line 13, in <module>

    arcpy.MakeFeatureLayer_management(layer, Flayer)

NameError: name 'Flayer' is not defined

Outcomes