AnsweredAssumed Answered

How to add Route Layer to Map using Arcpy.nax, Pro 2.5?

Question asked by jacquelinewillan on Aug 10, 2020
Latest reply on Aug 11, 2020 by jacquelinewillan

What is the best way to generate a route, that can be saved as a route, and displayed on the map, using Pro 2.5? I created a route using the arcpy.nax module (which I found is faster than using the to Make a Route Analysis Layer), and was able to save as a layer file:

routeLyr = result.saveAsLayerFile(WorkSpace + os.path.sep +  RouteName + ".lyr"), but then I want to add it to the map and choose the colors. When I tried the code below, I got an error: on the line for the mp.LayerFile:


curPrj ="CURRENT")
curMap = curPrj.listMaps("*")[0]

layerPath = WS + os.path.sep + RouteName + ".lyr"
lf =


I also tried: 


lf = ), but got an error for that too.  In 10.6 my users liked the fact that they could generate some routes and then go back later and add barriers, and to do that I can't just export the route to a feature class. Is there an alternate method to save/export the route? 


Any help on how to use python to display the layer or an alternate way to save/export a route would be greatly appreciated!