11 Turns

DEFINING TURNS

Finally, you have the option of creating a turntable. A turntable is, as the name implies, a table that holds information on which turns are allowed or not, and whether there is any impedance when using a turn, i.e. a left turn should take more time than a right turn.

Make the View window active.
Select the arcs at an intersection or junction that you want to create a turntable for. Use the the information in Record#, Tjunction and Fjunction to set up your table:

See Help for assistance in naming conventions for the fields.
The cost field (here: Minutes) contains the impedance value for making a particular turn. A negative value
In the example above, at node 344, going straight from link 776 to link 841 takes 1 minute; turning left from link 776 to 719 has an impedance value of 2 minutes, meaning: if the route turns left here, 2 minutes will be added to the total route cost. Making a U-turn has a negative value, -1, thus is not allowed.

Turntables can be created in Excel, saved as text files and added to the project, or created within the project:
Make the Project window active,
Tables > Add (to add an existing text file) or Tables > New to create a new table. Use the table edit procedures as outlined above to create fields, then Edit > Add Record to create a record, enter your values.

In order to use a turntable in a network solution, it must first be declared. This is done with an Avenue script:

With the Project view active,
Scroll and click on Scripts > New

Copy and Paste this script to the script window in ArcView (Use CTRL+V to paste):

‘ This script declares a turntable. Before running this script, you must
‘ have a project open with a turntable and a view open with a network theme.

‘ Get the view and the network theme. Substitute aViewName with the name of
‘ your view and aThemeName with the name of your network theme.

aView = av.GetProject.FindDoc(“aViewName”)
aNetworkTheme = aView.FindTheme(“aThemeName”)

‘ Make the network definition object

aNetwork = av.Run(“Network.GetNetwork”,{aNetworkTheme})

aNetDef = aNetwork.GetNetDef

‘ Get the turntable and declare it. Substitute aTurntableName with the name
‘ of your turntable.

aVTab = av.GetProject.FindDoc(“TURNTABLE_NAME_HERE”).GetVTab
aDeclaredTurntable = aNetDef.SetTurnVTab(aVTab)

‘ Make sure the turntable has been properly declared

if (aDeclaredTurntable) then
MsgBox.Info(“Your turntable has been declared”,”Turntable status”)
else
MsgBox.Info(“Unable to declare turntable”,”Turntable status”)

end

Replace
aView = av.GetProject.FindDoc(“aViewName”)
aNetworkTheme = aView.FindTheme(“aThemeName”)

with
aView = av.GetProject.FindDoc(“View1″)
aNetworkTheme = aView.FindTheme(“nonetwork”)

Click Script > Compile; then Script > Run

Upon completion, a message box tells you that your turntable has been declared.

If you accidentally delete the script from your project, you can retrieve it again from Help.