<?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 AddRuleToTopology_management error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219752#M16943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;AddRuleToTopology_management do not recognize a feature class, previously recognized and listed through arcpy.ListFeatureClasses() and checked by arcpy.CheckGeometry_manegement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is possible to add a new topology rule manually (arctoolbox &amp;gt; data management tools &amp;gt; topology &amp;gt; Addrule to topology) but not with Arcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CreateTopology_management(espaiFGD,"CS_l","#") &amp;gt;&amp;gt; OK&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddFeatureClassToTopology_management(espaiFGD+"/CS_l",espaiFGD+"/&lt;/SPAN&gt;&lt;STRONG&gt;CS&lt;/STRONG&gt;&lt;SPAN&gt;","1","1")&amp;nbsp; &amp;gt;&amp;gt; OK&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fcLlista = arcpy.ListFeatureClasses()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for fc in fcLlista:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CheckGeometry_management(espaiFGD+"/&lt;/SPAN&gt;&lt;STRONG&gt;CS&lt;/STRONG&gt;&lt;SPAN&gt;,path+"/CS_CheckGeometry") &amp;gt;&amp;gt; OK&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddRuleToTopology_management(Entrada1,"Must Not Overlap (Line)",espaiFGD+"/&lt;/SPAN&gt;&lt;STRONG&gt;CS&lt;/STRONG&gt;&lt;SPAN&gt;,"#","#","#")&amp;nbsp; &amp;gt;&amp;gt; Wrong&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error 000840: The value is not a&amp;nbsp; Feature Layer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Apr 2013 06:13:44 GMT</pubDate>
    <dc:creator>jordixirgo</dc:creator>
    <dc:date>2013-04-29T06:13:44Z</dc:date>
    <item>
      <title>AddRuleToTopology_management error</title>
      <link>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219752#M16943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;AddRuleToTopology_management do not recognize a feature class, previously recognized and listed through arcpy.ListFeatureClasses() and checked by arcpy.CheckGeometry_manegement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is possible to add a new topology rule manually (arctoolbox &amp;gt; data management tools &amp;gt; topology &amp;gt; Addrule to topology) but not with Arcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CreateTopology_management(espaiFGD,"CS_l","#") &amp;gt;&amp;gt; OK&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddFeatureClassToTopology_management(espaiFGD+"/CS_l",espaiFGD+"/&lt;/SPAN&gt;&lt;STRONG&gt;CS&lt;/STRONG&gt;&lt;SPAN&gt;","1","1")&amp;nbsp; &amp;gt;&amp;gt; OK&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fcLlista = arcpy.ListFeatureClasses()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for fc in fcLlista:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CheckGeometry_management(espaiFGD+"/&lt;/SPAN&gt;&lt;STRONG&gt;CS&lt;/STRONG&gt;&lt;SPAN&gt;,path+"/CS_CheckGeometry") &amp;gt;&amp;gt; OK&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddRuleToTopology_management(Entrada1,"Must Not Overlap (Line)",espaiFGD+"/&lt;/SPAN&gt;&lt;STRONG&gt;CS&lt;/STRONG&gt;&lt;SPAN&gt;,"#","#","#")&amp;nbsp; &amp;gt;&amp;gt; Wrong&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error 000840: The value is not a&amp;nbsp; Feature Layer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 06:13:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219752#M16943</guid>
      <dc:creator>jordixirgo</dc:creator>
      <dc:date>2013-04-29T06:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: AddRuleToTopology_management error</title>
      <link>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219753#M16944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having exactly the same issue. I realize the topic is old, but were you ever able to resolve the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 14:33:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219753#M16944</guid>
      <dc:creator>ThomasTri</dc:creator>
      <dc:date>2015-04-21T14:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: AddRuleToTopology_management error</title>
      <link>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219754#M16945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thomas, could you try disabling background processing, then run the tool again? Alternatively, I'd try running the tool from an IDE or command line and not the Python window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Shaun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 20:43:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219754#M16945</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2015-04-21T20:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: AddRuleToTopology_management error</title>
      <link>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219755#M16946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was using the PyScripter IDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to figure out the issue. In the AddFeatureClassToTopology and AddRuleToTopology geoprocessing tools, the full path to the feature class and topology name must be provided, even though arcpy.env.workspace was set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 20:50:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219755#M16946</guid>
      <dc:creator>ThomasTri</dc:creator>
      <dc:date>2015-04-21T20:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: AddRuleToTopology_management error</title>
      <link>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219756#M16947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doesn't seem to get old...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the same problem, AddRuleToTopology_management is returning with ERROR 999999, even though topology is set with full path, and so is the feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gdb
topo_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;gdb&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; topo&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fc_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;gdb&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddRuleToTopology_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;topo_path&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Must Not Intersect (Line)"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fc_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All paths are actually correct and of type String, but I always get 999999 in my face. That's in a stand-alone script I am developing in Eclipse. ArcGIS is in version 10.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When debuging then I can see the error is raised in line 16214 in the management.py file. Since I went step by step through the process I was able to confirm that all paths went correct through the gp_fixargs() function, and optional argument not given have been also correctly taken of the arguments list.&lt;/P&gt;&lt;P&gt;I assume the process is failing in the subsequent run of gp.AddRuleToTopology_management().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; AddRuleToTopology&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="number token"&gt;16208&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_base &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; gp&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; gp_fixargs
&lt;SPAN class="number token"&gt;16209&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;arcobjects&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;arcobjectconversion &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; convertArcObjectToPythonObject
&lt;SPAN class="number token"&gt;16210&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;16211&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retval &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; convertArcObjectToPythonObject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddRuleToTopology_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;gp_fixargs&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_topology&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; rule_type&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; in_featureclass&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; subtype&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; in_featureclass2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; subtype2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;16212&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; retval
&lt;SPAN class="number token"&gt;16213&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; Exception&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;16214&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;raise&lt;/SPAN&gt; e&lt;SPAN class="line-numbers-rows"&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:43:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219756#M16947</guid>
      <dc:creator>TomGeo</dc:creator>
      <dc:date>2021-12-11T10:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: AddRuleToTopology_management error</title>
      <link>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219757#M16948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you find a solution to this issue? &amp;nbsp;I am encountering the exact same thing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 19:46:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219757#M16948</guid>
      <dc:creator>MarcHunter1</dc:creator>
      <dc:date>2017-06-09T19:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: AddRuleToTopology_management error</title>
      <link>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219758#M16949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/13845"&gt;jordi xirgo&lt;/A&gt;‌ you should add features in your topology dataset before add rule on its.&lt;/P&gt;&lt;P&gt;As you done in your first code block:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="" style="color: #4d4d4d; background-color: #fefefe; font-size: 0.75em; margin-bottom: 1.5em;"&gt;AddFeatureClassToTopology_management(in_topology, in_featureclass, xy_rank, z_rank)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="position: absolute; left: -30px; top: 70.5227px;"&gt;&lt;DIV class="gtx-trans-icon"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 15:40:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addruletotopology-management-error/m-p/219758#M16949</guid>
      <dc:creator>Spatial_Fabio</dc:creator>
      <dc:date>2020-07-23T15:40:03Z</dc:date>
    </item>
  </channel>
</rss>

