<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5? in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435619#M4163</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Melinda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your quick response. I read through the materials again with your explanations in mind and I attempted to edit my script accordingly. I was going to give it a whirl again using the .nax module and&amp;nbsp;foregoing the arcpy.mp module (since the .nax module is more straightforward with exporting fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I had a&amp;nbsp;.nax module issue from the get-go. Even after checking out the network analyst extension, I am receiving this error on the following line:&lt;/P&gt;&lt;PRE style="color: #000000; background-color: #ffffff; border: 0px; font-weight: 400; font-size: 14px; padding: 1px 0px;"&gt;    route.load(arcpy.nax.RouteInputDatatype.Stops, input_stops)&lt;SPAN class="" style="color: #e75c58;"&gt;AttributeError&lt;/SPAN&gt;: module 'arcpy.nax' has no attribute 'RouteInputDatatype'&lt;/PRE&gt;&lt;P&gt;Is this a sign that I should instead try to utilize the arcpy.mp module in conjunction with the legacy arcpy.na module?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2020 18:51:34 GMT</pubDate>
    <dc:creator>JordanKing1</dc:creator>
    <dc:date>2020-07-28T18:51:34Z</dc:date>
    <item>
      <title>Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435617#M4161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Previously, I was working in ArcMap 10.6.1 and created a script utilizing the arcpy.na module.&amp;nbsp; I had no Python background prior to this rather large undertaking, so my (still limited) Python knowledge is based in ArcGIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of this script was to iterate through a set of polygons, select the intersecting points in each polygon, load these points into a new Network Analysis Route layer, solve that route, then move on to the next polygon and repeat.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It was working pretty well! Then, I decided to migrate to Pro 2.5...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was successful in most of my gp tool migrations. However, there are 2 major "module-based" issues I am having:&lt;/P&gt;&lt;P&gt;1. I am having difficulty understanding how to migrate from the arcpy.mapping module to the arcpy.mp module in Pro.&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;I've been a little confused with the differences between the .nax module and the legacy .na module, even after reading the "choose your module" help page. The .nax module seems much simpler and more straightforward, but it appears to not have the ability to create network analysis layers. That is the main function of my script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel as though I am back at square one trying to navigate these migrations. Does anyone have any experience moving to these new modules? Is anyone else in the same boat as me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2020 14:11:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435617#M4161</guid>
      <dc:creator>JordanKing1</dc:creator>
      <dc:date>2020-07-22T14:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435618#M4162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jordan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to keep your script mostly the same and continue to use NA layers, that will work.&amp;nbsp; But, as you have discovered, there are some code changes required, particularly with regards to working with the arcpy.mapping module in Pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This page has some tips about how to&amp;nbsp;migrate an NA layer-based workflow to Pro:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/migratingfrom10xarcpynetworkanalyst.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/migratingfrom10xarcpynetworkanalyst.htm"&gt;Migrating arcpy.na to ArcGIS Pro—Network Analyst module | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this page talks about migrating to Pro for the arcpy.mapping module:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/migratingfrom10xarcpymapping.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/mapping/migratingfrom10xarcpymapping.htm"&gt;Migrating from arcpy.mapping to ArcGIS Pro—ArcPy | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the newer arcpy.nax module: Yes, the workflows are more straightforward, and as you have noticed, they are not based on layers at all.&amp;nbsp; There is the ability to export an NA layer after solving the analysis, but the primary intent there is for debugging problems.&amp;nbsp; The primary assumption is that at the end of the day, most people just need the Service Area polygons or maybe just a couple of field values from the output of the analysis.&amp;nbsp; The arcpy.nax module allows you to access those things directly.&amp;nbsp; You can use the export() method to export the polygons to a feature class on disk, or you can loop through the analysis results using a search cursor if you just need to grab a few field values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are having trouble with a few specific lines of code, feel free to paste them here and I can take a look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2020 19:53:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435618#M4162</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2020-07-22T19:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435619#M4163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Melinda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your quick response. I read through the materials again with your explanations in mind and I attempted to edit my script accordingly. I was going to give it a whirl again using the .nax module and&amp;nbsp;foregoing the arcpy.mp module (since the .nax module is more straightforward with exporting fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I had a&amp;nbsp;.nax module issue from the get-go. Even after checking out the network analyst extension, I am receiving this error on the following line:&lt;/P&gt;&lt;PRE style="color: #000000; background-color: #ffffff; border: 0px; font-weight: 400; font-size: 14px; padding: 1px 0px;"&gt;    route.load(arcpy.nax.RouteInputDatatype.Stops, input_stops)&lt;SPAN class="" style="color: #e75c58;"&gt;AttributeError&lt;/SPAN&gt;: module 'arcpy.nax' has no attribute 'RouteInputDatatype'&lt;/PRE&gt;&lt;P&gt;Is this a sign that I should instead try to utilize the arcpy.mp module in conjunction with the legacy arcpy.na module?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 18:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435619#M4163</guid>
      <dc:creator>JordanKing1</dc:creator>
      <dc:date>2020-07-28T18:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435620#M4164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't give up yet!&amp;nbsp; You just have a capitalization error, and the code is case sensitive.&amp;nbsp; It's "Type", not "type" in "RouteInputDataType".&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/routeinputdatatype.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/routeinputdatatype.htm"&gt;RouteInputDataType—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 19:05:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435620#M4164</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2020-07-28T19:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435621#M4165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Melinda! That's all I needed to make it work, and it looks great!&lt;/P&gt;&lt;P&gt;The .nax module is definitely more straightforward and user-friendly; it looks like I saved myself about 20 lines of code with the switch.&lt;/P&gt;&lt;P&gt;I do have one (hopefully) last question, regarding the returnDirections property. I have read that .nax stores everything in memory, and I would like to view the turn-by-turn directions for the generated route. I do not have much experience with in-memory storage. Is there a quick line of code I can insert to call to the route directions output, using that returnDirections property on the route solver?&lt;/P&gt;&lt;P&gt;My purpose in viewing the directions is to see the sequence of the stops that are used on the route. Is there a better way to view the sequence using the .nax module than trying to view the directions output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2020 13:31:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435621#M4165</guid>
      <dc:creator>JordanKing1</dc:creator>
      <dc:date>2020-07-29T13:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435622#M4166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's definitely possible.&amp;nbsp; What you want is the Sequence field in the output Stops.&lt;/P&gt;&lt;P&gt;This page lists the field available in the outputs:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/route-output-data-types.htm#ESRI_SECTION1_72013C56F13F45A1BEA5E4AC1DE0FD58" title="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/route-output-data-types.htm#ESRI_SECTION1_72013C56F13F45A1BEA5E4AC1DE0FD58" rel="nofollow noopener noreferrer" target="_blank"&gt;Route output data types—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way to access that field is to use the export() method to save the output Stops to a feature class and then use it the same way you would any feature class.&amp;nbsp; But if you just want to get the sequence values, you can use searchCursor() to access them directly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; route&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;solve&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Name'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'RouteName'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Sequence'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;searchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;nax&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RouteOutputDataType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Stops&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the documentation for searchCursor:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/solverresultsearchcursor.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/solverresultsearchcursor.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;SolverResultSearchCursor—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:31:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435622#M4166</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2021-12-11T19:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435623#M4167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Melinda,&lt;/P&gt;&lt;P&gt;Thanks again for all the help lately! That method worked perfectly and I feel confident with the .nax module for routing now!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Down the line we are possibly going to be using this script to host map services, so I am also trying to fix the .na module code to work in Pro and to better my understanding of its differences. Now I am having difficulty with the MakeRouteAnalysisLayer method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;On this line:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;layer_object = arcpy.na.MakeRouteAnalysisLayer(network, route_name, "Driving Time", "FIND_BEST_ORDER", "", "", "ALONG_NETWORK", "", "DIRECTIONS", "")&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;I am receiving this error:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;TypeError: MakeRouteAnalysisLayer() takes from 0 to 9 positional arguments but 10 were given&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;I am&amp;nbsp;working from this syntax:&lt;/P&gt;&lt;PRE class="" style="color: #4c4c4c; background-color: #ffffff; font-size: 17px; margin-bottom: 1.55rem;"&gt;&lt;STRONG&gt;MakeRouteAnalysisLayer(network_data_source, {layer_name}, {travel_mode}, {sequence}, {time_of_day}, {time_zone}, {line_shape}, {accumulate_attributes}, {generate_directions_on_solve}, {time_zone_for_time_fields})&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;Previously, when I attempted to modify my code for use in Pro (before my initial post requesting help), it was not returning this error. Any insight into this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Jordan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2020 18:44:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435623#M4167</guid>
      <dc:creator>JordanKing1</dc:creator>
      <dc:date>2020-08-03T18:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435624#M4168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The&amp;nbsp;time_zone_for_time_fields parameter was just added at ArcGIS Pro 2.6, so if you have not updated to 2.6 yet, that's probably the source of the error.&amp;nbsp; You can just leave out the last "" in your call to MakeRouteAnalysisLayer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2020 18:54:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435624#M4168</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2020-08-03T18:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435625#M4169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, ok that makes sense. I didn't see an option to view syntax specifically for 2.5; is that documented somewhere or is it more of an understanding gained from working in Pro more and more?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That worked for me, but I am now getting an error when I try to load my points into the stops sublayer. I am wondering if it is a similar issue, where one of the parameters I am using is only for 2.6?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the block of code I am using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;layer_object = arcpy.na.MakeRouteAnalysisLayer(network,route_name,"Driving Time","FIND_BEST_ORDER","","","ALONG_NETWORK","","DIRECTIONS").getOutput(0)

sublayer_names = arcpy.na.GetNAClassNames(layer_object)
stops_sublayer_name = sublayer_names["Stops"]
routes_sublayer_name = sublayer_names["Routes"]

arcpy.na.AddLocations(layer_object, stops_sublayer_name, input_points, "", "5000 Meters", "IDNO", "", "MATCH_TO_CLOSEST", "APPEND", "NO_SNAP", "5 Meters", "INCLUDE", "")
arcpy.na.Solve(layer_object, "SKIP")‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the error returned on line 7:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000840: The value is not a Network Analyst Layer.
Failed to execute (AddLocations).&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am confused as to why it is not recognizing my "layer_object" as an NA Layer, especially because I can see the NA Layers being added to my map and table of contents while the script is running.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I apologize for&amp;nbsp;asking so&amp;nbsp;many questions! I am usually pretty good about being able to research my errors and figure out a solution, but I feel like with all the updates to Pro and new modules I need to utilize, I'm having difficulty finding common errors and solution documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:31:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435625#M4169</guid>
      <dc:creator>JordanKing1</dc:creator>
      <dc:date>2021-12-11T19:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435626#M4170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah the ArcMap doc had a little selector box on each page that let you view the page for previous software release versions, but I don't see that in Pro.&amp;nbsp; I'm not sure why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code looks fine, so I don't know why it's not working.&amp;nbsp; You could try&amp;nbsp;route_name instead of layer_object in the AddLocations input.&amp;nbsp; That should also work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:54:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435626#M4170</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2020-08-06T19:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Best tips for migrating an arcpy.na script from ArcMap 10.6.1 to Pro 2.5?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435627#M4171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I figured it out!&lt;/P&gt;&lt;P&gt;I was trying to re-run my script after fixing a different error. I had env.overwriteOutput = True at the top of my script, but for some reason I think it wasn't actually overwriting the NA Layers in the file gdb.&amp;nbsp;I have read that it's a common error with newer versions of Pro on some features for whatever reason.&lt;/P&gt;&lt;P&gt;Once I removed the previously created NA Layer from my last script attempt, the new NA Layer was created without error and my stops were added with AddLocations just fine. Hopefully this helps for anyone else having similar issues!&lt;/P&gt;&lt;P&gt;Thanks again for all your help, Melinda. My scripts are both working great now with .nax, .na, and .mp utilization!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2020 20:35:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/best-tips-for-migrating-an-arcpy-na-script-from/m-p/435627#M4171</guid>
      <dc:creator>JordanKing1</dc:creator>
      <dc:date>2020-08-07T20:35:16Z</dc:date>
    </item>
  </channel>
</rss>

