Hello everyone,
I would like to build a function in python that removes all topology layers from a feature dataset.
How can I check if a feature dataset has topology with arcpy, and also how can identify topology layers to delete them.
Thanks
I took the liberty of using the Syntax highlighter to make your code more readable. (here is one of the many posts that describe using it: Posting code with Syntax Highlighting on GeoNet )
<SPAN class="comment token"># Import arcpy module</SPAN> <SPAN class="keyword token">import</SPAN> arcpy <SPAN class="comment token"># Local variables:</SPAN> MyFC_Topology <SPAN class="operator token">=</SPAN> <SPAN class="string token">"...\\FGDB.gdb\\MyFD\\MyFC_Topology"</SPAN> <SPAN class="comment token"># Process: Delete</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Delete_management<SPAN class="punctuation token">(</SPAN>MyFC_Topology<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Topology"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
It appears you are on you way...
Thank you.
I just hard coded the name of the Topology FC and it works
here is the saple I used to test:
# Import arcpy moduleimport arcpy# Local variables:MyFC_Topology = "...\\FGDB.gdb\\MyFD\\MyFC_Topology"# Process: Deletearcpy.Delete_management(MyFC_Topology, "Topology")
Have you taken a look here: Common topology tasks—Topologies | ArcGIS Desktop ?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.