I'm writing a script in python that loops the LayerToKML conversion tool on a set of layers; the problem is that the first execution works fine, while the rest (hundreds) produce .kmz files like this...
...all the geometries are invisible and placed at the Equator or North Pole, while the attributes are correct.
I run the script with an IDE (PyScripter, 32 Bit, python 2.7.2): if I do it with the ArcGIS (10.1) python window, it works instead!
PS: athis is the code function that I use to convert the shapefiles:
def creatingKmz(fcKmz,fcName): arcpy.MakeFeatureLayer_management(fcKmz, fcName) arcpy.ApplySymbologyFromLayer_management(fcName,inFolder + os.sep + fc + ".lyr") arcpy.LayerToKML_conversion(fcName,outKMZDirectory + os.sep + fcName + ".kmz","1","false",arcpy.Describe(fcName).extent,"","","CLAMPED_TO_GROUND") arcpy.Delete_management(fcKmz)