<?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 How to rewrite javascript script to work in ArcGis 10.x? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-rewrite-javascript-script-to-work-in-arcgis/m-p/545569#M50799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! I just started working and my job right now is to rewrite parts of javascript scripts that work in older version of ArcGis to work in version 10.x. I came across two problems, which I tried to google but didn't find anything helpful:&lt;BR /&gt;1)&lt;BR /&gt;var GP = WScript.CreateObject("esriGeoprocessing.GPDispatch.1");&lt;BR /&gt;GP.SetProduct("ArcView");&lt;BR /&gt;GP.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx"); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GP.AddField_management("shapeFile.shp", "len", "DOUBLE");&lt;BR /&gt;GP.CalculateField_management("shapeFile.shp", "len", "[Shape.length]");&lt;BR /&gt;&lt;BR /&gt;CalculateField seems to work only if I rewrite a value of one field, but not if I want to calculate it. In this case I would like to get length of a polyline.&lt;BR /&gt;I tried different sytax: "!Shape.length!", and with fourth argument "PYTHON_9.3" but it still didn't work.&lt;BR /&gt;&lt;BR /&gt;2)&lt;BR /&gt;var GP = WScript.CreateObject("esriGeoprocessing.GPDispatch.1");&lt;BR /&gt;GP.SetProduct("ArcView");&lt;BR /&gt;GP.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx"); &amp;nbsp; GP.TableToTable_conversion(table, mdbFile, "tableName");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TableToTable throws error and I don't know why. "table" is accessed using: D:\\path...\\database.mdb\\table is this ok? Where table is a table in database.mdb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;BR /&gt;Thank you! Nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Nov 2016 07:07:49 GMT</pubDate>
    <dc:creator>NinaMejac</dc:creator>
    <dc:date>2016-11-10T07:07:49Z</dc:date>
    <item>
      <title>How to rewrite javascript script to work in ArcGis 10.x?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-rewrite-javascript-script-to-work-in-arcgis/m-p/545569#M50799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! I just started working and my job right now is to rewrite parts of javascript scripts that work in older version of ArcGis to work in version 10.x. I came across two problems, which I tried to google but didn't find anything helpful:&lt;BR /&gt;1)&lt;BR /&gt;var GP = WScript.CreateObject("esriGeoprocessing.GPDispatch.1");&lt;BR /&gt;GP.SetProduct("ArcView");&lt;BR /&gt;GP.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx"); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GP.AddField_management("shapeFile.shp", "len", "DOUBLE");&lt;BR /&gt;GP.CalculateField_management("shapeFile.shp", "len", "[Shape.length]");&lt;BR /&gt;&lt;BR /&gt;CalculateField seems to work only if I rewrite a value of one field, but not if I want to calculate it. In this case I would like to get length of a polyline.&lt;BR /&gt;I tried different sytax: "!Shape.length!", and with fourth argument "PYTHON_9.3" but it still didn't work.&lt;BR /&gt;&lt;BR /&gt;2)&lt;BR /&gt;var GP = WScript.CreateObject("esriGeoprocessing.GPDispatch.1");&lt;BR /&gt;GP.SetProduct("ArcView");&lt;BR /&gt;GP.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx"); &amp;nbsp; GP.TableToTable_conversion(table, mdbFile, "tableName");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TableToTable throws error and I don't know why. "table" is accessed using: D:\\path...\\database.mdb\\table is this ok? Where table is a table in database.mdb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;BR /&gt;Thank you! Nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 07:07:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-rewrite-javascript-script-to-work-in-arcgis/m-p/545569#M50799</guid>
      <dc:creator>NinaMejac</dc:creator>
      <dc:date>2016-11-10T07:07:49Z</dc:date>
    </item>
  </channel>
</rss>

