I'm having exactly the same issue. I realize the topic is old, but were you ever able to resolve the issue?
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.
Cheers,
Shaun
I was using the PyScripter IDE.
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.
Doesn't seem to get old...
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.
arcpy.env.workspace = gdb
topo_path = os.path.join(gdb, fd, topo)
fc_path = os.path.join(gdb, fd, fc)
arcpy.AddRuleToTopology_management(topo_path, "Must Not Intersect (Line)", fc_path)
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
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.
I assume the process is failing in the subsequent run of gp.AddRuleToTopology_management().
--> AddRuleToTopology
16208 from arcpy.geoprocessing._base import gp, gp_fixargs
16209 from arcpy.arcobjects.arcobjectconversion import convertArcObjectToPythonObject
16210 try:
16211 retval = convertArcObjectToPythonObject(gp.AddRuleToTopology_management(*gp_fixargs((in_topology, rule_type, in_featureclass, subtype, in_featureclass2, subtype2), True)))
16212 return retval
16213 except Exception, e:
16214 raise e
Did you find a solution to this issue? I am encountering the exact same thing.
jordi xirgo you should add features in your topology dataset before add rule on its.
As you done in your first code block:
AddFeatureClassToTopology_management(in_topology, in_featureclass, xy_rank, z_rank)