<?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 Kml to Layer in Script Gives No Result in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/kml-to-layer-in-script-gives-no-result/m-p/423198#M33254</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to build a tool that converts a layer to a kmz at the end. I tested the following code in my IDE and it works fine. But once I add the exact same lines as a script to ArcPro and run it from there it produces nothing. I have tried this on different layers (group/single) and all with the same result so I don't think it's specific to my layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm wondering why this happens. Workarounds are fine too as long as I can get the script to run in ArcPro.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;KmzOutput= r"C:\Users\tracy\OneDrive\Documents\Python Scripts\Sample.kmz"&lt;BR /&gt;LayerFile= r"E:\\GIS_DoNotSynch\\ArcpyToolFiles\\Scratch\\Sample.lyrx"&lt;BR /&gt;arcpy.LayerToKML_conversion(LayerFile,KmzOutput)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Nov 2019 00:14:51 GMT</pubDate>
    <dc:creator>TracyLiu</dc:creator>
    <dc:date>2019-11-12T00:14:51Z</dc:date>
    <item>
      <title>Kml to Layer in Script Gives No Result</title>
      <link>https://community.esri.com/t5/python-questions/kml-to-layer-in-script-gives-no-result/m-p/423198#M33254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to build a tool that converts a layer to a kmz at the end. I tested the following code in my IDE and it works fine. But once I add the exact same lines as a script to ArcPro and run it from there it produces nothing. I have tried this on different layers (group/single) and all with the same result so I don't think it's specific to my layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm wondering why this happens. Workarounds are fine too as long as I can get the script to run in ArcPro.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;KmzOutput= r"C:\Users\tracy\OneDrive\Documents\Python Scripts\Sample.kmz"&lt;BR /&gt;LayerFile= r"E:\\GIS_DoNotSynch\\ArcpyToolFiles\\Scratch\\Sample.lyrx"&lt;BR /&gt;arcpy.LayerToKML_conversion(LayerFile,KmzOutput)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2019 00:14:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kml-to-layer-in-script-gives-no-result/m-p/423198#M33254</guid>
      <dc:creator>TracyLiu</dc:creator>
      <dc:date>2019-11-12T00:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Kml to Layer in Script Gives No Result</title>
      <link>https://community.esri.com/t5/python-questions/kml-to-layer-in-script-gives-no-result/m-p/423199#M33255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tracy,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My name is Adam I work in Esri support, Thank you for the post, we are investigating this tools&amp;nbsp;on support case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try a layer instead of a layer file?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

in_feature = r'C:\GIS\My_Data.shp'
out_kml = r'C:\GIS\my_KMZ_test.kmz'

arcpy.MakeFeatureLayer_management(in_feature, "Map_Layer")
arcpy.LayerToKML_conversion("Map_Layer", out_kml) &lt;SPAN class="" style="border-right: 1px solid #999999; padding-top: 1em;"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this works or not,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Adam&lt;/P&gt;&lt;P&gt;Esri Support Services.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:07:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/kml-to-layer-in-script-gives-no-result/m-p/423199#M33255</guid>
      <dc:creator>AdamEversole1</dc:creator>
      <dc:date>2021-12-11T19:07:13Z</dc:date>
    </item>
  </channel>
</rss>

