How to remove all topology layers from a feature dataset

856
3
01-29-2020 06:05 AM
JoseSanchez
Occasional Contributor III

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

0 Kudos
3 Replies
JoeBorgione
MVP Emeritus

Have you taken a look here:  Common topology tasks—Topologies | ArcGIS Desktop  ?

That should just about do it....
0 Kudos
JoseSanchez
Occasional Contributor III

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 module
import arcpy
# Local variables:
MyFC_Topology = "...\\FGDB.gdb\\MyFD\\MyFC_Topology"
# Process: Delete
arcpy.Delete_management(MyFC_Topology, "Topology")

0 Kudos
JoeBorgione
MVP Emeritus

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 )

# Import arcpy module
import arcpy
# Local variables:
MyFC_Topology = "...\\FGDB.gdb\\MyFD\\MyFC_Topology"
# Process: Delete
arcpy.Delete_management(MyFC_Topology, "Topology")

 

It appears you are on you way...

That should just about do it....
0 Kudos