<?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: How to continue the iteration when solve routes fail? in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741140#M7097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mention python, but your screenshot shows Model Builder.&amp;nbsp; I'll try to answer this question for both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Model Builder, you can use that Solve Succeeded turquoise-colored bubble as a precondition for the next step in your workflow, I think.&amp;nbsp; If it's false, it should just skip whatever comes next.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In python, you can use try/except:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; arcpy.na.Solve(blah...)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; print("Solve succeeded.")&lt;/P&gt;&lt;P&gt;except:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; print("Solve failed.&amp;nbsp; Error messages:")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; print(arcpyGetMessages(2))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Oct 2017 21:38:12 GMT</pubDate>
    <dc:creator>MelindaMorang</dc:creator>
    <dc:date>2017-10-12T21:38:12Z</dc:date>
    <item>
      <title>How to continue the iteration when solve routes fail?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741139#M7096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm doing an iteration process to solve different shortest paths for different combinations of points. But the iteration stops when there is no solution for one combination. I&amp;nbsp;think I may need if-else statement to check if solve fails, so I create a boolean variable "Terminate on solve error" to make it go through next step, but it still stuck at solve.&lt;/P&gt;&lt;P&gt;I'm new to python so don't know how to achieve this function. I attach the errors and part of the model in the screenshots. Does anyone have suggestions?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 21:01:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741139#M7096</guid>
      <dc:creator>ChongyangZhu</dc:creator>
      <dc:date>2017-10-12T21:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to continue the iteration when solve routes fail?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741140#M7097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mention python, but your screenshot shows Model Builder.&amp;nbsp; I'll try to answer this question for both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Model Builder, you can use that Solve Succeeded turquoise-colored bubble as a precondition for the next step in your workflow, I think.&amp;nbsp; If it's false, it should just skip whatever comes next.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In python, you can use try/except:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; arcpy.na.Solve(blah...)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; print("Solve succeeded.")&lt;/P&gt;&lt;P&gt;except:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; print("Solve failed.&amp;nbsp; Error messages:")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; print(arcpyGetMessages(2))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 21:38:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741140#M7097</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2017-10-12T21:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to continue the iteration when solve routes fail?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741141#M7098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Melinda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;Yes I'm using the model builder and if it's possible, I want to achieve this without python. but if not, I'll try python code.&lt;/P&gt;&lt;P&gt;I just tried to use it as precondition of "Select Data" but the process still stuck at "Solve". It seems to me that the process is not able to go through "Solve" so that I can't use the parameter that "Solve" generates.&lt;/P&gt;&lt;P&gt;Can you tell me what should I do to insert this python code into this model? Shall I insert the python code by "Calculate Value"?&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 22:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741141#M7098</guid>
      <dc:creator>ChongyangZhu</dc:creator>
      <dc:date>2017-10-12T22:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to continue the iteration when solve routes fail?</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741142#M7099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use 'CONTINUE' for parameter &lt;STRONG&gt;&lt;EM&gt;terminate_on_solve_error&lt;/EM&gt;&lt;/STRONG&gt; . For details:&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/network-analyst-toolbox/solve.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.3/tools/network-analyst-toolbox/solve.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 09:23:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/how-to-continue-the-iteration-when-solve-routes/m-p/741142#M7099</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2018-01-22T09:23:08Z</dc:date>
    </item>
  </channel>
</rss>

