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


scale = 10000


for layer in arcpy.ListFiles():

        arcpy.MakeFeatureLayer_management(layer, Flayer)

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

                                        '', pixels, dpi, clamped)


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





Error :

Traceback (most recent call last):

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

    arcpy.MakeFeatureLayer_management(layer, Flayer)

NameError: name 'Flayer' is not defined