<?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 format a VB script in Python for Calculate Field? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-to-format-a-vb-script-in-python-for-calculate/m-p/402251#M13612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you So much sir... I made changes u suggested and it is running in arc 10...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but this syntax is running on arc 9.3..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for the quick reply and help :):)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Jun 2013 03:52:22 GMT</pubDate>
    <dc:creator>JyotiNayak</dc:creator>
    <dc:date>2013-06-15T03:52:22Z</dc:date>
    <item>
      <title>How to format a VB script in Python for Calculate Field?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-format-a-vb-script-in-python-for-calculate/m-p/402249#M13610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a script for my model in VB which I am running on arcgis 9.3. The same script is for calculate field is not running on arc gis 10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I need to recode or format it in python? I am not good in python so i appreciate if this problem can be solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am mentioning the syntax of vb script for reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.CalculateField_management(New_shp__2_, "Angle", "pp", "VB", "dim pp as double\\nif [dir_y]&amp;gt;0 and [dir_x] &amp;gt; 0 then \\npp=57.27 *ATN([dir_y]/[dir_x])\\nelseif [dir_y]&amp;gt;0 and [dir_x]&amp;lt;0 then \\npp=180-(57.27*ATN(-[dir_y]/[dir_x]))\\nelseif [dir_y]&amp;gt;0 and [dir_x] = 0&amp;nbsp; then\\npp=90\\n\\nelseif [dir_y]&amp;lt;0 and [dir_x]&amp;gt;0 then \\npp=360 - ABS(57.27*(-ATN(-[dir_y]/[dir_x])))\\nelseif [dir_y]&amp;lt;0 and [dir_x]&amp;lt;0 then \\npp= 360-ABS(57.27*ATN([dir_y]/[dir_x])-180)\\nelseif [dir_y]&amp;lt;0 and [dir_x]=0 then \\npp=270\\n\\n\\nelseif [dir_y]&amp;lt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and [dir_x]&amp;gt;0 then \\npp=360 - ABS(57.27*(-ATN(-[dir_y]/[dir_x])))\\nelseif [dir_y]&amp;lt;0 and [dir_x]&amp;lt;0 then \\npp= 360 - ABS (57.27 * ATN([dir_y]/[dir_x])-180)\\nelseif [dir_y]&amp;lt;0 and [dir_x]=0 then \\npp=270\\n\\n\\nelseif [dir_x] &amp;gt; 0 then\\npp=0\\nelseif [dir_x] &amp;gt; 0&amp;nbsp;&amp;nbsp; and [dir_x]&amp;lt;0 then\\npp=180\\nelse\\npp=0\\nend if\\n")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 08:17:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-format-a-vb-script-in-python-for-calculate/m-p/402249#M13610</guid>
      <dc:creator>JyotiNayak</dc:creator>
      <dc:date>2013-06-14T08:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a VB script in Python for Calculate Field?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-format-a-vb-script-in-python-for-calculate/m-p/402250#M13611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use still specify the code as 'VB', that is good, but it's really VBScript...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"VBScript does not allow you to explicitly declare any data types; all variables are implicitly Variant. Statements like Dim x as String should be removed or simplified to Dim x."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Calculate_Field_examples/00170000004s000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Calculate_Field_examples/00170000004s000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 12:01:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-format-a-vb-script-in-python-for-calculate/m-p/402250#M13611</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-06-14T12:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to format a VB script in Python for Calculate Field?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-format-a-vb-script-in-python-for-calculate/m-p/402251#M13612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you So much sir... I made changes u suggested and it is running in arc 10...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but this syntax is running on arc 9.3..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for the quick reply and help :):)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jun 2013 03:52:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-format-a-vb-script-in-python-for-calculate/m-p/402251#M13612</guid>
      <dc:creator>JyotiNayak</dc:creator>
      <dc:date>2013-06-15T03:52:22Z</dc:date>
    </item>
  </channel>
</rss>

