<?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 How to overwrite existing Voxel Scene Layer (.slpk) with the same service name via Python automation? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-overwrite-existing-voxel-scene-layer-slpk/m-p/1632675#M11499</link>
    <description>&lt;P&gt;I'm currently developing an automated workflow using Python and ArcGIS Pro 3.5 to generate and publish a Voxel Scene Layer (.slpk) to our ArcGIS Enterprise Portal. The workflow runs every 10 minutes, and the data content is dynamic (radar-based voxel data). Our goal is to &lt;STRONG&gt;keep the service name fixed as radar&lt;/STRONG&gt;, so that other downstream apps and dashboards depending on this service don’t break or require updates.&lt;/P&gt;&lt;P&gt;Here's what I've tried:&lt;/P&gt;&lt;HR /&gt;&lt;H3&gt;What I'm currently doing:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Update .lyrx file content (e.g., maxLabel, colorRangeMax)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Use arcpy.CreateVoxelSceneLayerContent_management() to generate a new .slpk&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Attempt to &lt;STRONG&gt;overwrite&lt;/STRONG&gt; the existing Portal item named radar&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;HR /&gt;&lt;H3&gt;&amp;nbsp;Issues encountered:&lt;/H3&gt;&lt;H4&gt;1. SharePackage() fails with naming conflict:&lt;/H4&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;ERROR 001398: Service name 'radar4D' already exists.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Because SharePackage() doesn’t support overwriting, and simply fails if the service name already exists—even after deleting the Portal item via gis.content.search().delete().&lt;/P&gt;&lt;H4&gt;2. Tried using arcpy.sharing.CreateSharingDraft(), but this returns None when used with .slpk:&lt;/H4&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class=""&gt;import&lt;/SPAN&gt; sharing sharing_draft = sharing.CreateSharingDraft(&lt;SPAN class=""&gt;"HOSTING_SERVER"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"SCENE_SERVICE"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"radar4D"&lt;/SPAN&gt;, slpk_path) &lt;SPAN class=""&gt;# --&amp;gt; returns NoneType, so attributes like .portalFolder raise AttributeError&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H4&gt;3. Tried UploadServiceDefinition_server() with .sd, but it's unclear how to generate an .sd from .slpk.&lt;/H4&gt;&lt;HR /&gt;&lt;H3&gt;&amp;nbsp;My goal:&lt;/H3&gt;&lt;P&gt;I simply want to &lt;STRONG&gt;automatically overwrite an existing Voxel Scene Layer&amp;nbsp;every 10 minutes&lt;/STRONG&gt;, with updated .slpk content, using Python. No change in URL or service name.&lt;/P&gt;&lt;P&gt;Is there any supported method to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Overwrite a hosted Scene Layer (from .slpk) via Python or arcpy?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Delete the existing service cleanly (not just the Portal item) so SharePackage() can reuse the same name?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Or any alternative method (e.g., REST API, Service Definition workflows) that works with voxel .slpk?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;H3&gt;Environment:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;ArcGIS Pro 3.5 (licensed)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;arcpy 3.5&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Python script running in scheduled job&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;ArcGIS Enterprise Portal (10.9.1)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Logged in via arcpy.SignInToPortal(...)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;H3&gt;Any help, examples, or official recommendations would be greatly appreciated!&lt;/H3&gt;&lt;P&gt;Thank you in advance&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Jul 2025 02:38:46 GMT</pubDate>
    <dc:creator>文瑞蘇</dc:creator>
    <dc:date>2025-07-12T02:38:46Z</dc:date>
    <item>
      <title>How to overwrite existing Voxel Scene Layer (.slpk) with the same service name via Python automation?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-overwrite-existing-voxel-scene-layer-slpk/m-p/1632675#M11499</link>
      <description>&lt;P&gt;I'm currently developing an automated workflow using Python and ArcGIS Pro 3.5 to generate and publish a Voxel Scene Layer (.slpk) to our ArcGIS Enterprise Portal. The workflow runs every 10 minutes, and the data content is dynamic (radar-based voxel data). Our goal is to &lt;STRONG&gt;keep the service name fixed as radar&lt;/STRONG&gt;, so that other downstream apps and dashboards depending on this service don’t break or require updates.&lt;/P&gt;&lt;P&gt;Here's what I've tried:&lt;/P&gt;&lt;HR /&gt;&lt;H3&gt;What I'm currently doing:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Update .lyrx file content (e.g., maxLabel, colorRangeMax)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Use arcpy.CreateVoxelSceneLayerContent_management() to generate a new .slpk&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Attempt to &lt;STRONG&gt;overwrite&lt;/STRONG&gt; the existing Portal item named radar&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;HR /&gt;&lt;H3&gt;&amp;nbsp;Issues encountered:&lt;/H3&gt;&lt;H4&gt;1. SharePackage() fails with naming conflict:&lt;/H4&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;ERROR 001398: Service name 'radar4D' already exists.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Because SharePackage() doesn’t support overwriting, and simply fails if the service name already exists—even after deleting the Portal item via gis.content.search().delete().&lt;/P&gt;&lt;H4&gt;2. Tried using arcpy.sharing.CreateSharingDraft(), but this returns None when used with .slpk:&lt;/H4&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class=""&gt;import&lt;/SPAN&gt; sharing sharing_draft = sharing.CreateSharingDraft(&lt;SPAN class=""&gt;"HOSTING_SERVER"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"SCENE_SERVICE"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"radar4D"&lt;/SPAN&gt;, slpk_path) &lt;SPAN class=""&gt;# --&amp;gt; returns NoneType, so attributes like .portalFolder raise AttributeError&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H4&gt;3. Tried UploadServiceDefinition_server() with .sd, but it's unclear how to generate an .sd from .slpk.&lt;/H4&gt;&lt;HR /&gt;&lt;H3&gt;&amp;nbsp;My goal:&lt;/H3&gt;&lt;P&gt;I simply want to &lt;STRONG&gt;automatically overwrite an existing Voxel Scene Layer&amp;nbsp;every 10 minutes&lt;/STRONG&gt;, with updated .slpk content, using Python. No change in URL or service name.&lt;/P&gt;&lt;P&gt;Is there any supported method to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Overwrite a hosted Scene Layer (from .slpk) via Python or arcpy?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Delete the existing service cleanly (not just the Portal item) so SharePackage() can reuse the same name?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Or any alternative method (e.g., REST API, Service Definition workflows) that works with voxel .slpk?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;H3&gt;Environment:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;ArcGIS Pro 3.5 (licensed)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;arcpy 3.5&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Python script running in scheduled job&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;ArcGIS Enterprise Portal (10.9.1)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Logged in via arcpy.SignInToPortal(...)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;H3&gt;Any help, examples, or official recommendations would be greatly appreciated!&lt;/H3&gt;&lt;P&gt;Thank you in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jul 2025 02:38:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-overwrite-existing-voxel-scene-layer-slpk/m-p/1632675#M11499</guid>
      <dc:creator>文瑞蘇</dc:creator>
      <dc:date>2025-07-12T02:38:46Z</dc:date>
    </item>
  </channel>
</rss>

