<?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 Set Subtype Field Spinning in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/set-subtype-field-spinning/m-p/264426#M20372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to remove subtypes from a number of tables with python. I tested things on fgdb copy of the sde data. Everything worked fine. However, when I run it in our sde dev environment it makes it past the first two tables then just hangs.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried it with the ArcCatolog tool on the problem table. It has been running for 25 minutes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; font-size: 9.0pt;"&gt;arcpy.SetSubtypeField_management(table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;clear_value&lt;/SPAN&gt;=&lt;SPAN style="color: #a5c261;"&gt;'TRUE'&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;The tables have a large number of subtypes. Some tables have over 260! (someone did not understand how to use subtypes...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did remove sde locks before trying to remove them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone ever run across this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jun 2019 23:17:17 GMT</pubDate>
    <dc:creator>forestknutsen1</dc:creator>
    <dc:date>2019-06-20T23:17:17Z</dc:date>
    <item>
      <title>Set Subtype Field Spinning</title>
      <link>https://community.esri.com/t5/python-questions/set-subtype-field-spinning/m-p/264426#M20372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to remove subtypes from a number of tables with python. I tested things on fgdb copy of the sde data. Everything worked fine. However, when I run it in our sde dev environment it makes it past the first two tables then just hangs.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried it with the ArcCatolog tool on the problem table. It has been running for 25 minutes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; font-size: 9.0pt;"&gt;arcpy.SetSubtypeField_management(table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;clear_value&lt;/SPAN&gt;=&lt;SPAN style="color: #a5c261;"&gt;'TRUE'&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;The tables have a large number of subtypes. Some tables have over 260! (someone did not understand how to use subtypes...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did remove sde locks before trying to remove them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone ever run across this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2019 23:17:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-subtype-field-spinning/m-p/264426#M20372</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2019-06-20T23:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set Subtype Field Spinning</title>
      <link>https://community.esri.com/t5/python-questions/set-subtype-field-spinning/m-p/264427#M20373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up removing each subtype independently with its subtype code. This worked...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcpy
&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcgisscripting

connection = xxxxxx

arcpy.env.workspace = connection
tables = [&lt;SPAN style="color: #a5c261;"&gt;"T_StructureAsset"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;          &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"T_MiscellaneousAsset"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;          &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"T_FoundationAsset"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;          &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"T_GuyAsset"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;          &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"T_AnchorAsset"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;]

&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;table &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;tables:
    &lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;' &lt;/SPAN&gt;+ &lt;SPAN style="color: #a5c261;"&gt;'*' &lt;/SPAN&gt;* &lt;SPAN style="color: #6897bb;"&gt;40
&lt;/SPAN&gt;&lt;SPAN style="color: #6897bb;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;'Remove subtypes for ' &lt;/SPAN&gt;+ table
    subtypes = arcpy.da.ListSubtypes(table)
    &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;k&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;v &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;subtypes.items():
        &lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;'Removing subtype code: ' &lt;/SPAN&gt;+ &lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(k)
        &lt;SPAN style="color: #cc7832;"&gt;try&lt;/SPAN&gt;:
            arcpy.RemoveSubtype_management(table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;k)
        &lt;SPAN style="color: #cc7832;"&gt;except &lt;/SPAN&gt;arcgisscripting.ExecuteError:
            &lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;' &lt;/SPAN&gt;+ arcpy.GetMessages() + &lt;SPAN style="color: #a5c261;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;'
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:57:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-subtype-field-spinning/m-p/264427#M20373</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2021-12-11T12:57:25Z</dc:date>
    </item>
  </channel>
</rss>

