<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcPy Batch KML Script in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104530#M46331</link>
    <description>&lt;P&gt;Thanks, Dan.&lt;/P&gt;&lt;P&gt;I added in a specified output folder.&lt;/P&gt;&lt;P&gt;LineList = []&lt;/P&gt;&lt;P&gt;LayerList = ["Structures", "Transmission Circuit"]&lt;BR /&gt;OutputFolder = "H:\"&lt;/P&gt;&lt;P&gt;print("Preparing files")&lt;/P&gt;&lt;P&gt;for Line in LineList:&lt;BR /&gt;for Layer in LayerList:&lt;/P&gt;&lt;P&gt;kmlname = OutputFolder + str(Line) + "." + str(Layer) + ".kmz"&lt;BR /&gt;sql = "legacycircuitid = '" + str(Line) +"'"&lt;BR /&gt;arcpy.management.SelectLayerByAttribute(Layer, 'NEW_SELECTION', sql)&lt;BR /&gt;arcpy.conversion.LayerToKML(Layer, kmlname)&lt;BR /&gt;print("KMZ created for " + str(Line) + " " + str(Layer))&lt;/P&gt;&lt;P&gt;I'd like to import this into a gp tool so the engineers can simply specify the ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 19:14:11 GMT</pubDate>
    <dc:creator>AdCulver</dc:creator>
    <dc:date>2021-10-04T19:14:11Z</dc:date>
    <item>
      <title>ArcPy Batch KML Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104029#M46246</link>
      <description>&lt;P&gt;Looking for help with my script. I am getting an error on line 11 with ".kmz".&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;LineList = [381001,&lt;BR /&gt;691001]&lt;/P&gt;&lt;P&gt;LayerList = ["Structures","Transmission Circuit"]&lt;/P&gt;&lt;P&gt;for Line in LineList:&lt;BR /&gt;for Layer in LayerList:&lt;/P&gt;&lt;P&gt;kmlname = "\\fs01\Inspection Programs\CVI\2021\Inspections\Drone\" + str(Line) + "." + Layer + ".kmz"&lt;BR /&gt;sql = "legacycircuitid = '" + str(Line) +"'"&lt;BR /&gt;arcpy.management.SelectLayerByAttribute(Layer, 'NEW_SELECTION', sql)&lt;BR /&gt;arcpy.conversion.LayerToKML(Layer, kmlname)&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 17:55:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104029#M46246</guid>
      <dc:creator>AdCulver</dc:creator>
      <dc:date>2021-10-01T17:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Batch KML Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104092#M46254</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;will provide line numbers and proper formatting... as it is shown now&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp;&lt;SPAN&gt;kmlname = "\\fs01\Inspection P.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;probably won't work since you haven't set an environment workspace in your script&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 20:10:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104092#M46254</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-10-01T20:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Batch KML Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104530#M46331</link>
      <description>&lt;P&gt;Thanks, Dan.&lt;/P&gt;&lt;P&gt;I added in a specified output folder.&lt;/P&gt;&lt;P&gt;LineList = []&lt;/P&gt;&lt;P&gt;LayerList = ["Structures", "Transmission Circuit"]&lt;BR /&gt;OutputFolder = "H:\"&lt;/P&gt;&lt;P&gt;print("Preparing files")&lt;/P&gt;&lt;P&gt;for Line in LineList:&lt;BR /&gt;for Layer in LayerList:&lt;/P&gt;&lt;P&gt;kmlname = OutputFolder + str(Line) + "." + str(Layer) + ".kmz"&lt;BR /&gt;sql = "legacycircuitid = '" + str(Line) +"'"&lt;BR /&gt;arcpy.management.SelectLayerByAttribute(Layer, 'NEW_SELECTION', sql)&lt;BR /&gt;arcpy.conversion.LayerToKML(Layer, kmlname)&lt;BR /&gt;print("KMZ created for " + str(Line) + " " + str(Layer))&lt;/P&gt;&lt;P&gt;I'd like to import this into a gp tool so the engineers can simply specify the ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 19:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104530#M46331</guid>
      <dc:creator>AdCulver</dc:creator>
      <dc:date>2021-10-04T19:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Batch KML Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104531#M46332</link>
      <description>&lt;LI-CODE lang="python"&gt;import arcpy
LineList = []

LayerList = ["Structures", "Transmission Circuit"]
OutputFolder = "H:\"

print("Preparing files")

for Line in LineList:
    for Layer in LayerList:

        kmlname = OutputFolder + str(Line) + "." + str(Layer) + ".kmz"
        sql = "legacycircuitid = '" + str(Line) +"'"
        arcpy.management.SelectLayerByAttribute(Layer, 'NEW_SELECTION', sql)
        arcpy.conversion.LayerToKML(Layer, kmlname)
        print("KMZ created for " + str(Line) + " " + str(Layer))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Oct 2021 19:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104531#M46332</guid>
      <dc:creator>AdCulver</dc:creator>
      <dc:date>2021-10-04T19:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Batch KML Script</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104561#M46337</link>
      <description>&lt;P&gt;the last line of my comment... the script as it stands has no clue where to find those layers&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 20:25:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-batch-kml-script/m-p/1104561#M46337</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-10-04T20:25:23Z</dc:date>
    </item>
  </channel>
</rss>

