<?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 Calculate an line feature with conditional  in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852024#M2043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying build a model to calculate a line feature with a conditional but it's not working and e it's returnig an syntax error at the expression line &amp;lt;return !shape.length@kilometers!/40*60&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what to do, can you guys give me a hand?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def Reclass(TIPO_PAV, CLASSIFICACAO &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (TIPO_PAV=='ASFALTO' and CLASSIFICACAO=='URBANA'):&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 10000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (TIPO_PAV=='TERRA' and CLASSIFICACAO=='URBANA'):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 10000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (TIPO_PAV=='TERRA'):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return !shape.length@kilometers! /40*60&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (TIPO_PAV=='ASFALTO'):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return !shape.length@kilometers!&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2018 19:07:47 GMT</pubDate>
    <dc:creator>FlavioFelix</dc:creator>
    <dc:date>2018-03-09T19:07:47Z</dc:date>
    <item>
      <title>Calculate an line feature with conditional</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852024#M2043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying build a model to calculate a line feature with a conditional but it's not working and e it's returnig an syntax error at the expression line &amp;lt;return !shape.length@kilometers!/40*60&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what to do, can you guys give me a hand?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def Reclass(TIPO_PAV, CLASSIFICACAO &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (TIPO_PAV=='ASFALTO' and CLASSIFICACAO=='URBANA'):&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 10000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (TIPO_PAV=='TERRA' and CLASSIFICACAO=='URBANA'):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 10000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (TIPO_PAV=='TERRA'):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return !shape.length@kilometers! /40*60&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (TIPO_PAV=='ASFALTO'):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return !shape.length@kilometers!&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 19:07:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852024#M2043</guid>
      <dc:creator>FlavioFelix</dc:creator>
      <dc:date>2018-03-09T19:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate an line feature with conditional</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852025#M2044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like just a missing parenthesis.&amp;nbsp; Your current code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; !shape&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length@kilometers! &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;40&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;60&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&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;Should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!shape&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length@kilometers! &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;40&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;60&lt;/SPAN&gt;‍‍&lt;SPAN class="line-numbers-rows"&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'm guessing?)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 19:12:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852025#M2044</guid>
      <dc:creator>JamesMacKay3</dc:creator>
      <dc:date>2018-03-09T19:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate an line feature with conditional</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852026#M2045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh No !!!&lt;/P&gt;&lt;P&gt;Even when I fix the parenthesis it keep the same error syntax.&lt;/P&gt;&lt;P&gt;I'd tryied to simplify the code just writing &amp;lt;&amp;nbsp; return !shape.length@kilometers! &amp;gt; with or without parenthesis and keep returning the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;any other idea ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 19:29:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852026#M2045</guid>
      <dc:creator>FlavioFelix</dc:creator>
      <dc:date>2018-03-09T19:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate an line feature with conditional</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852027#M2046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh No !!!&lt;/P&gt;&lt;P&gt;Even when I fix the parenthesis it keep the same error syntax.&lt;/P&gt;&lt;P&gt;I'd tryied to simplify the code just writing &amp;lt;&amp;nbsp; return !shape.length@kilometers! &amp;gt; with or without parenthesis and keep returning the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;any other idea ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 19:29:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852027#M2046</guid>
      <dc:creator>FlavioFelix</dc:creator>
      <dc:date>2018-03-09T19:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate an line feature with conditional</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852028#M2047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you open your Geoprocessing Results window you should see the failed calculator run.&amp;nbsp; If you expand it and view the messages, does it provide any additional information?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 20:00:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852028#M2047</guid>
      <dc:creator>JamesMacKay3</dc:creator>
      <dc:date>2018-03-09T20:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate an line feature with conditional</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852029#M2048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After tryied many diferents ways to do it I've got this solution by using expression !shape.length@kilometers! in other field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def Reclass(TIPO_PAV, CLASSIFICACAO,Distancia_Km &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; if TIPO_PAV=='ASFALTO' and CLASSIFICACAO=='URBANA':&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return 10000&lt;BR /&gt;&amp;nbsp; if TIPO_PAV=='TERRA' and CLASSIFICACAO=='URBANA':&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return 10000&lt;BR /&gt;&amp;nbsp; if TIPO_PAV=='TERRA':&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return Distancia_Km/40*60&lt;BR /&gt;&amp;nbsp; if TIPO_PAV=='ASFALTO':&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return Distancia_Km&lt;BR /&gt;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return "VERIFICAR"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 20:41:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-an-line-feature-with-conditional/m-p/852029#M2048</guid>
      <dc:creator>FlavioFelix</dc:creator>
      <dc:date>2018-03-09T20:41:11Z</dc:date>
    </item>
  </channel>
</rss>

