Hello everybody,
I am creating a Python AddIn, that creates a topology, then adds a feature layer and rules to it. After I run the topology validation, I would like to add the topology to the mxd that is open.
When I set arcpy.env.addOutputsToMap to True, it adds the topology but before I add the rules, features and validation. Is there any way to add the topology once everything is done?
Thanks,
Tim
Solved! Go to Solution.
Hey Ian,
I was able to turn addOutput to True before Add rule and Validate, which gave me the desired result. If that wouldn't have worked, I would have used ExportTopologyErrors_management and added the output feature layer to my mxd.
Tim
According to several older threads, you cannot directly add topology layers to a map using Arcpy.
https://community.esri.com/thread/93229
This begs the question though, clearly the geoprocessing operation can create a layer file of the Geoprocessing Result object of the geoprocessing operation, and that layer is clearly added to the map when you have the addOutputs to True in the environment variable.
I wonder if there is a way to turn on the addOutput to True after you add the rules, features and validation, then recall the output or the result object in a way it would add it to the map.
Hey Ian,
I was able to turn addOutput to True before Add rule and Validate, which gave me the desired result. If that wouldn't have worked, I would have used ExportTopologyErrors_management and added the output feature layer to my mxd.
Tim