0

I m using ArcGIS 10.4.1 and Network Analyst extension, in the network dataset properties-> Attributes. I created an attribute called PromoteStops1, next in Script Evaluators, I used the following script to force VRP solver to travel entire streets segments. (The basic idea is that if a street has deliveries you it better not to leave that street until there are no more deliveries). The deliveries have service time so this script works as follows;

restricted = False
a = Turn.Angle
If a >= 45 Then
    If fromEdge.AttributeValueByName("ServiceTim")= 0.5 And toEdge.AttributeValueByName("ServiceTim") = 0.5 Then
        restricted = True
    End If
End If

enter image description here

enter image description here

(ServiceTim is the field name in road's shapefile attributes table).

When I try to solve the VRP I get the following message;

Error: The evaluator failed to return a value. [Attribute: PromoteStops1,

Source: FT_Attica_Roads_Final_Clip1_Spa, OID = 4002, EID = 3406]

Error: Network element evaluator error. [Script Control Error -2147352319]

enter image description here

Is there anything wrong with the variable names?

  • Please Edit the question to make your code legible by using code formatting ({}) and placing the error message in the question body as text (which makes it legible on all devices and searchable by future users). Please take the Tour. – Vince Dec 18 '17 at 12:03
1

I see two possible sources of errors:

  • Edges do not have turn angle, turns do.

So, a=Turn.Angle will receive invalid values, if so.

  • Any value used in the pre-logic script code must be passed as a parameter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.