<?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 Directions using arcpy in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/directions-using-arcpy/m-p/468047#M4469</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to use arcpy to generate directions for each route and save it for each day.&amp;nbsp; From help section this is what I have.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
arcpy.na.Directions("Network Analysis Layer","TEXT","C:/temp/" + day1 + ".txt","Miles","REPORT_TIME","Minutes")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I have an mxd which has a VRP Layer, how to best use arcpy to access it and loop to generate all directions.&amp;nbsp; I have my routes named as Day1, Day2, Day3 etc.,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Pawan&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS Desktop 10.1 (Advanced)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jun 2014 16:53:05 GMT</pubDate>
    <dc:creator>PawanVuppala</dc:creator>
    <dc:date>2014-06-10T16:53:05Z</dc:date>
    <item>
      <title>Directions using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/directions-using-arcpy/m-p/468047#M4469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to use arcpy to generate directions for each route and save it for each day.&amp;nbsp; From help section this is what I have.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
arcpy.na.Directions("Network Analysis Layer","TEXT","C:/temp/" + day1 + ".txt","Miles","REPORT_TIME","Minutes")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I have an mxd which has a VRP Layer, how to best use arcpy to access it and loop to generate all directions.&amp;nbsp; I have my routes named as Day1, Day2, Day3 etc.,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Pawan&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS Desktop 10.1 (Advanced)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 16:53:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/directions-using-arcpy/m-p/468047#M4469</guid>
      <dc:creator>PawanVuppala</dc:creator>
      <dc:date>2014-06-10T16:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Directions using arcpy</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/directions-using-arcpy/m-p/468048#M4470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi!&amp;nbsp; If you have an MXD with several layer files saved in it already, you can access those layer files and put them into a list as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#Get a list of all the layers in the map document
mxd = arcpy.mapping.MapDocument(mxd_path)
lyrs = arcpy.mapping.ListLayers(mxd)
#Filter the list to obtain only the network analyst layers
na_layers = [lyr for lyr in lyrs if lyr.isNetworkAnalystLayer]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can then iterate through this list when generating directions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're doing this from the python window in ArcMap instead of a standalone script, replace mxd_path in the script above with "CURRENT".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:44:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/directions-using-arcpy/m-p/468048#M4470</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2021-12-11T20:44:35Z</dc:date>
    </item>
  </channel>
</rss>

