Good day,
I'm exploring using Arc Hydro's Trace by AH Attributes tool in a Python script as an alternative to ArcGIS Pro's built-in Trace tool. Following is our test script:
import arcpy
import tracebyahattributes
arcpy.MakeFeatureLayer_management('C:/GIS/test/PBF2.gdb/CWFHydrology3', 'hydro_lyr')
flags = 'C:/GIS/test/PBF2.gdb/Flag'
barriers = 'C:/GIS/test/PBF2.gdb/AllOthers'
tracebyahattributes.traceviaAttributesAH(in_points=flags, in_streams='hydro_lyr', trace_direction='Upstream', search_distance='50', max_next_lines=0, in_barriers=barriers)
print(arcpy.GetCount_management('hydro_lyr'))
Unlike running the tool interactively, I cannot seem to get the selected hydrology segments (it does not make a selection on the passed hydro_lyr)! Is this tool only intended to be run in an interactive ArcGIS Pro session, or is there is something else that can be done to get the selected hydrology segments in the script?
Thanks in advance,
Randal