<?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: Network Analyst and Script Evaluators:  accessing attributes, get &amp;quot;network element evaluator error&amp;quot; in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469547#M4496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, but it did not work.&amp;nbsp; That is a lower-case L variable.&amp;nbsp; Defining it is NOT necessary in Python.&amp;nbsp; I can verify that.&amp;nbsp; If I do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def SetCost(value):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c=0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if value!=0:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c=100/value&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value = SetCost(0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it runs without error, but does not access SPEED_LIM as I need it to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I ONLY change the call to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value = SetCost("SPEED_LIM")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the same error as noted in my original post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 May 2018 18:16:04 GMT</pubDate>
    <dc:creator>BradSrebnik</dc:creator>
    <dc:date>2018-05-07T18:16:04Z</dc:date>
    <item>
      <title>Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469541#M4490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a route using Network Analyst.&amp;nbsp; Just at the beginning stages of setting this up for a school project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a feature class called RoadsClipped, and successfully set up a Network Dataset called Roads_ND using it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm trying to customize the routing cost using evaluators.&amp;nbsp; I want to use attributes in RoadsClipped, but anything I've tried to access those attributes results in a "Network element evaluator error".&amp;nbsp; I've tried both VBScript and Python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some simple examples are below.&amp;nbsp; I've tried literally hundreds of variations and nothing work unless I forego trying to look at the attribute entirely.&amp;nbsp; These are just simple tests to see if I can get at the attributes in RoadsClipped, and not the real logic I'll eventually use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;def SetCost(value):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; a=Edge.AttributeValueByName(value)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; c=0&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; if l!=0:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c=100/a&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; return c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;value=SetCost("SPEED_LIM")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VBScript:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;a=0&lt;BR /&gt;a=Edge.AttributeValueByName("SPEED_LIM")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;value = a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2018 19:00:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469541#M4490</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-06T19:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469542#M4491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;More information.&amp;nbsp; I'm using ArcMap Desktop 10.5.1 on Windows 7.&amp;nbsp; RoadsClipped has about 2000 records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2018 19:03:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469542#M4491</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-06T19:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469543#M4492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The variables in your 'def' aren't defined anywhere, so your logic can't be tested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2018 20:37:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469543#M4492</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-05-06T20:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469544#M4493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply...&amp;nbsp; All the examples in ESRI help that I could find (two for each of VBScript and Python) do not define the variables.&amp;nbsp; How do you do that?&amp;nbsp; I just tried adding a "Dim l" line to the VBScript and still got the same error.&amp;nbsp; I don't think you need to define variables for Python, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2018 20:51:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469544#M4493</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-06T20:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469545#M4494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note ....&amp;nbsp; This isn't freestanding script code.&amp;nbsp; It's entered in Network Dataset Properties, Attributes tab, click on Evaluators, set to Script, click on Evaluator Properties.&amp;nbsp; The main part of the code is the "Pre-Logic Script Code", and the last line that sets the value is the actual call.&amp;nbsp; I followed (roughly) examples from &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/types-of-evaluators-used-by-a-network.htm" title="http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/types-of-evaluators-used-by-a-network.htm"&gt;Types of evaluators used by a network—Help | ArcGIS Desktop&lt;/A&gt; and &lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/editing-network-datasets-assigning-evaluators.htm" title="https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/editing-network-datasets-assigning-evaluators.htm"&gt;Assigning evaluators—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 May 2018 20:55:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469545#M4494</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-06T20:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469546#M4495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you just trying to read a value from the RoadsClipped attribute table and use that to derive the cost?&amp;nbsp; If so, you don't need a Script evaluator.&amp;nbsp; You can use a Field evaluator.&amp;nbsp; Like with script, click on Evaluator Properties to open up the dialog where you can set up some pre-logic script code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was your python example from before:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;SetCost&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;value&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;Edge&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AttributeValueByName&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;value&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; c&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; l&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;100&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;a
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; c
 
value&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;SetCost&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SPEED_LIM"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that for a field evaluator, you do not need Edge.AttributeValueByName(value).&amp;nbsp; In this case, "value" will be the field value read from the RoadsClipped attribute table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, let's just say the speed limit is 30, as an example.&amp;nbsp; You don't need the "a" variable at all.&amp;nbsp; You can just use "value".&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;SetCost&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;value&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; c&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; l&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;100&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;value
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; c
 
value&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;SetCost&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SPEED_LIM"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is "l"?&amp;nbsp; I think this is where your problem lies.&amp;nbsp; As Dan says above, this variable isn't defined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:48:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469546#M4495</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2021-12-11T20:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469547#M4496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, but it did not work.&amp;nbsp; That is a lower-case L variable.&amp;nbsp; Defining it is NOT necessary in Python.&amp;nbsp; I can verify that.&amp;nbsp; If I do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def SetCost(value):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c=0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if value!=0:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c=100/value&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value = SetCost(0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it runs without error, but does not access SPEED_LIM as I need it to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I ONLY change the call to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value = SetCost("SPEED_LIM")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the same error as noted in my original post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 18:16:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469547#M4496</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-07T18:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469548#M4497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's in your SPEED_LIM field in your data?&amp;nbsp; Maybe it has null values that need to be handled separately.&amp;nbsp; If there were a null value, then the script would fail (because 100/null is undefined) and would return an error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 18:32:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469548#M4497</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2018-05-07T18:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469549#M4498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is an integer.&amp;nbsp; One record has a null value.&amp;nbsp; That's why I check if value is 0.&amp;nbsp; In any case, that is not the problem.&amp;nbsp; I just change it to another attribute that is also an integer and has no null values.&amp;nbsp; I get the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping to find someone who has used these evaluator scripts to get at the underlying data so I can see a working sample.&amp;nbsp; I searched for hours on the web and could find nothing other than the link I gave above.&amp;nbsp; Everyone else trying it ran into problems.&amp;nbsp; I tried to call ESRI today, but with a student license, they wouldn't talk to me (I'm trying to get permission through the University).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 18:43:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469549#M4498</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-07T18:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469550#M4499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;0 is not equivalent to Null in this case.&amp;nbsp; You would have to check "is null" or just "if not value".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might be a stupid question, but after you made the changes to your evaluator, did you re-build the network?&amp;nbsp; If not, it won't have picked up any of the changes, so you would still get the same error as before.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 18:50:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469550#M4499</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2018-05-07T18:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469551#M4500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did not rebuild the network and I don't think you need to.&amp;nbsp; As I noted above, when I changed the call to "Value = SetCost(0)" it does not produce an error (and every other working, but useless simple test works without rebuilding).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 19:49:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469551#M4500</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-07T19:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469552#M4501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't explain why your simple test with Value=SetCost(0) worked.&amp;nbsp; However, speaking as an member of the Network Analyst development team, I can vouch for the fact that you DO need to rebuild your network when you make any changes to the attributes and their evaluators.&amp;nbsp; Otherwise the changes will not get properly baked into the network, so at that point all bets are off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To re-build your network, find it in the Catalog pane, right-click it, and choose Build.&amp;nbsp; Alternatively, use the Build Network geoprocessing tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try this and see if it fixes the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 19:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469552#M4501</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2018-05-07T19:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469553#M4502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again... Some updates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I changed to using Field not Script evaluators as you suggested.&amp;nbsp; With Field evaluators, I can see SPEED_LIM in the list of fields and use it in the script, so that is very good!&amp;nbsp; I don't recall seeing any example of field evaluator scripts in the ESRI help so I thought they were only simple things like constants.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With field evaluators, it does appear that you need to re-build, as you say.&amp;nbsp; That didn't seem to be the case with script evaluators.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still have no idea what the difference between field and script evaluators is, other than that field evaluators give you access to the fields successfully.&amp;nbsp; The ESRI help has examples with script evaluators doing something like that, but it doesn't seem to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 20:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469553#M4502</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-07T20:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469554#M4503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One step forward, on backwards&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now have (again, to test that I can access the fields) this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def SetCost():&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lim=!SPEED_LIM!&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cost=10000&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if lim is not null:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cost=lim&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return cost&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value = SetCost()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Verify says the syntax is OK.&amp;nbsp; As you suggest, I re-Build the dataset.&amp;nbsp; It says there is an error with every object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SourceName: RoadsClipped, ObjectID: 1, Network object evaluator error.&lt;BR /&gt;SourceName: RoadsClipped, ObjectID: 2, Network object evaluator error.&lt;BR /&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 20:18:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469554#M4503</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-07T20:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469555#M4504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Field evaluators allow you to read from the fields in the source feature classes and do simple script-related operations with them.&amp;nbsp; When you build the network, the values are read from the data and any associated script is run, and the values themselves are baked into the network at that time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script evaluators are meant for doing more complex and customized calculations that require access to multiple other network attributes and their parameters, network edge and junction properties, and other fancy things.&amp;nbsp; The scripts here are evaluated at solve time rather than during the network build, so they are much slower.&amp;nbsp; Rather than just looking up a stored value, they have to actually evaluate the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since, during the previous discussion, you were still using a script evaluator, that explains why changing the value to 0 did not require a re-build.&amp;nbsp; However, it also explains why my suggestions did not work for you, since they were based on the assumption that you were now using a field evaluator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't worry.&amp;nbsp; This stuff is confusing, and you're right that the documentation does not always provide good examples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 20:37:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469555#M4504</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2018-05-07T20:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469556#M4505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now you're on the right track. Try something more like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;SetCost&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lim&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cost&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10000&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lim &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; null&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cost&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;lim
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; cost
 
Value &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SetCost&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!SPEED_LIM!&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Value= box, you have to pass in the field value.&amp;nbsp; Then, in the function, it retrieves the value as an argument.&amp;nbsp; As it was, you were passing nothing to the function, and the function was trying to get the value from the field, but it doesn't know how to do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With all that said, the logic here doesn't make sense to me.&amp;nbsp; You're saying that the cost should be 10,000, unless the input field has a non-null value, in which case the cost should equal the speed limit.&amp;nbsp; Shouldn't the cost be a function of the speed limit and the length of the street (assuming you're calculating time)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe at this point you should tell me what your goal is.&amp;nbsp; What are you really trying to calculate?&amp;nbsp; Then perhaps I can better advise on the best way to achieve this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:48:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469556#M4505</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2021-12-11T20:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469557#M4506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For background, we are hoping to use more than one field to set the cost.&amp;nbsp; The examples I've given do not necessarily make sense - they are only to test that I can access the field and do SOME sort of calculation.&amp;nbsp; If I am limited to only getting access to one field that may be a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 20:53:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469557#M4506</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-07T20:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469558#M4507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use more than one field in a field evaluator.&amp;nbsp; You can pass in multiple fields to your function.&amp;nbsp; Here's a made-up example:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;def&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d74444; border: 0px; font-weight: inherit;"&gt;SetCost&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;lim, dist&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cost&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit;"&gt;10000&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;if&lt;/SPAN&gt; lim &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;is&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;not&lt;/SPAN&gt; null&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cost&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt;lim/dist
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;return&lt;/SPAN&gt; cost
 
Value &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; SetCost&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;!SPEED_LIM!, !DISTANCE!&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:48:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469558#M4507</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2021-12-11T20:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469559#M4508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent!&amp;nbsp; Thank you!&amp;nbsp; I will work with this and let you know how it goes...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 21:08:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469559#M4508</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-07T21:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Network Analyst and Script Evaluators:  accessing attributes, get "network element evaluator error"</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469560#M4509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This still does not work.&amp;nbsp; Even simplifying to the following gives a network object evaluator error for every object when I re-Build:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def SetCost(lim):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cost=10000&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lim is not null:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cost=lim*lim&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return cost&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value = SetCost(!SPEED_LIM!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 21:45:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/network-analyst-and-script-evaluators-accessing/m-p/469560#M4509</guid>
      <dc:creator>BradSrebnik</dc:creator>
      <dc:date>2018-05-07T21:45:32Z</dc:date>
    </item>
  </channel>
</rss>

