Hi Rob,
For the Descriptor attribute you created, what was the Data Type you specified? I'm guessing Integer. The data types for network attributes are all numeric, so you're going to need to have the Field evaluator in your Descriptor attribute convert the text to a number. I'm not sure what values you have in your text fields, but you may want to convert, say, "LR" to 1 and other values to 0.
So in the Field evaluator for your Descriptor attribute, you need to specify an expression like:
Code:
fieldAsInteger = 0
Select Case [myField]
Case "LR": fieldAsInteger = 1
End Select
with a return value of fieldAsInteger
Note that the above is similar in structure to the Field evaulators used in the Oneway network attribute in the Tutorial data for Network Analyst.
Then in the VB Script evaluator for your restriction attribute, you can specify looking for the numeric value 1:
Code:
restricted = false
a = Turn.Angle
If a > 210 And a < 330 Then
If toEdge.AttributeValueByName( "Left Restriction" ) = 1 Then
restricted = True
End If
End If
with a return value of restricted
Let me know if you have any further questions.
Alan
Bookmarks