I am trying to transform a kml to shapefile via ArcPy with the following code:
import arcpy # Variables KML to Shapefile: KML = r"C:\Test\Polygons.kml" Output_Location = r"C:\Test" Polygons_lyr = "Polygons_lyr" Polygons_geo = r"C:\Test\Polygons_geo.shp" Polygons_shape = r"C:\Test\Polygons.shp" Polygons_gdb = Output_Location Polygons_lyr = "Polygons_example" Polygon_select = Polygons_gdb # Process: KML_To_Layer arcpy.KMLToLayer_conversion(KML, Output_Location, Polygons_lyr, "NO_GROUNDOVERLAY") # Process: Select_Data arcpy.SelectData_management(Polygons_gdb, "Placemarks\\Polygons") # Process: Select arcpy.Select_analysis(Polygon_select, Polygons_geo, "") # Process: Project arcpy.Project_management(Polygons_geo, Polygons_shape, "PROJCS['WGS_1984_UTM_Zone_19S',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['false_easting',500000.0],PARAMETER['false_northing',10000000.0],PARAMETER['central_meridian',-69.0],PARAMETER['scale_factor',0.9996],PARAMETER['latitude_of_origin',0.0],UNIT['Meter',1.0]]", "", "", "NO_PRESERVE_SHAPE", "") When I run it, it performs the gdb and the layer:
But when (it seems) when selecting the file in the GDB, the problem occurs. It gives me the following error:
Traceback (most recent call last): File "c:/Test/KML_to_shapefile.py", line 17, in arcpy.SelectData_management(Polygons_gdb, "Placemarks\Polygons") File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\management.py", line 4310, in SelectData raise e arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000800: The value is not a member of KML_to_shapefile.py | Polygons.kml | Polygons_example.gdb | Polygons_example.lyr. Failed to execute (SelectData).
The error is in line 17, that is in the "arcpy.SelectData_management" function.
How is it possible to fix it?

This tool is intended for use in ModelBuilder and not in Python scripting.