<?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: Field calculate vb to python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277116#M21374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help on the python code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still not able to get anything other than "0" in the fields.&lt;/P&gt;&lt;P&gt;I am trying to create a contour map that i could make very 50 or 100 contour stand out.&lt;/P&gt;&lt;P&gt;attached a pic of what my contour data looks like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Oct 2018 17:30:25 GMT</pubDate>
    <dc:creator>TonyAlmeida</dc:creator>
    <dc:date>2018-10-16T17:30:25Z</dc:date>
    <item>
      <title>Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277113#M21371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a model that i am trying to add a field then do a filed calculate but i am having trouble getting it right. I have tried the following in VB but keep getting the following error. So i was wondering if someone could help maybe right this in python unless someone can help me get the VB script right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VB Error&lt;/P&gt;&lt;P&gt;ERROR 999999: Error executing function.&lt;BR /&gt;Expected end of statement&lt;BR /&gt;Failed to execute (Calc Index 50')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Pre&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Logis Script Code&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

dim cont &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; Long
If&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;CONTOUR_FEET&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; MOD &lt;SPAN class="number token"&gt;50&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; Then
cont&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
Else
cont&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
End &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;

INDEX_50FT&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;
cont&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:29:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277113#M21371</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2021-12-11T13:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277114#M21372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never mind i for got that VB doesn't let you &lt;SPAN&gt;declare any data types&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;dim cont
If&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;CONTOUR_FEET&lt;SPAN class=""&gt;]&lt;/SPAN&gt; MOD &lt;SPAN class=""&gt;50&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; Then
cont&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;
Else
cont&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;
End &lt;SPAN class=""&gt;if

But my code doesn't do anyting i have "0" in the INDEX_50ft field.
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:29:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277114#M21372</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2021-12-11T13:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277115#M21373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Python in Field calculator:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/424464_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 17:10:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277115#M21373</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-10-16T17:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277116#M21374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help on the python code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still not able to get anything other than "0" in the fields.&lt;/P&gt;&lt;P&gt;I am trying to create a contour map that i could make very 50 or 100 contour stand out.&lt;/P&gt;&lt;P&gt;attached a pic of what my contour data looks like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 17:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277116#M21374</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2018-10-16T17:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277117#M21375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Presumably some of your records are truly divisible by 50?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 17:42:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277117#M21375</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-10-16T17:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277118#M21376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren i just thought of that. It doesn't seem as some of my records are. I mad contours from a DEM with the Contour tool with contour interval = 2. I assuming in need to re-create my contours from the DEM at every 50 feet if so how do i do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 17:52:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277118#M21376</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2018-10-16T17:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277119#M21377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to me that if you make contours at every 50 feet, you won't need the expression.&amp;nbsp; Looks&amp;nbsp;like you made contours every 2 feet (or 2 meters?&amp;nbsp; I don't know what units your dem is in...) &lt;EM&gt;Assuming&amp;nbsp;&lt;/EM&gt;units are feet, why don't you try 10 feet intervals?&amp;nbsp; or 20 feet intervals?&amp;nbsp; What level of detail are you looking to display? What is the topography of your area of interest?&amp;nbsp; If you are looking at farm land in Kansas, perhaps your 2 foot interval is appropriate: if you are looking at the Alaska Range, you'll want to go much greater...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 18:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277119#M21377</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-10-16T18:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277120#M21378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wasn't sure how to make contours, the approach i took was us the Focal Statistics tool run that on the DEM, then use the contour tool. Which I didn't know what actually the "contour interval" meant. I guess what through me off was that the DEM was in meters. I was making it harder that what i should have been.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My main object was to create a contour map that would display contours every 50 or 100 feet a different color, a nice cartographic appearance. Which is why i created a new fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 18:52:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277120#M21378</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2018-10-16T18:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate vb to python</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277121#M21379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="background-color: #ffffff;"&gt;I was making it harder that what i should have been&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Haven't done that since.... This morning!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 19:35:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-vb-to-python/m-p/277121#M21379</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-10-16T19:35:40Z</dc:date>
    </item>
  </channel>
</rss>

