I am using PyScripter and ArcMap
import arcpy
# set up workspace and input feature class
arcpy.env.workspace = r"H:\Data_Processing\Work\PL07\Mygdb.gdb"
fc = "County"
# create a topology for the feature class
topology = arcpy.CreateTopology_management(arcpy.env.workspace, "topology")
arcpy.AddFeatureClassToTopology_management(topology, fc, 1, 1)
# add topology rules to the topology
arcpy.AddRuleToTopology_management(topology, "Must Not Overlap (Area)", fc)
arcpy.AddRuleToTopology_management(topology, "Must Not Have Gaps (Area)", fc)
arcpy.AddRuleToTopology_management(topology, "Must Not Self-Intersect (Line)", fc)
# validate the topology to find errors
error_table = arcpy.ValidateTopology_management(topology)
# loop through the error table to print out error messages
with arcpy.da.SearchCursor(error_table, ["RuleDescription", "Description"]) as cursor:
for row in cursor:
print("Error: {} - {}".format(row[0], row[1]))
"
I get the error below (how do I fix it?)
Traceback (most recent call last):
File "<module3>", line 32, in <module>
File "E:\Program Files (x86)\ArcGIS\Desktop10.8\ArcPy\arcpy\management.py", line 18933, in CreateTopology
raise e
ExecuteError: ERROR 000271: Cannot open the input datasets
Failed to execute (CreateTopology).