SegmentPreferences property

Returns or sets the preferred type of travel for a segment of a route; similar to viewing or setting Quickest, Shortest, or Preferred on the Segments tab of the More Route Options dialog box. Read/write GeoSegmentPreferences.

GeoSegmentPreferences Value Description
geoSegmentPreferred
2
Travel on preferred roads as set in the Preferred Roads dialog box
geoSegmentQuickest
0
Travel using the quickest route
geoSegmentShortest
1
Travel using the shortest route

Applies to

Objects:  Waypoint

Syntax

object.SegmentPreferences

Parameters

Part Description
object Required. An expression that returns a Waypoint object.

Example

    Sub ChangeSegmentPreferences()

  Dim objApp As New MapPoint.Application   Dim objMap As MapPoint.Map   Dim objRoute As MapPoint.Route
  'Set up the application   Set objMap = objApp.ActiveMap   Set objRoute = objMap.ActiveRoute   objApp.Visible = True   objApp.UserControl = True
  'Add route stops   objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)   objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)
  'Change preferred road setting for highways, then route based on these preferences and calculate the route   objRoute.DriverProfile.PreferredRoads(geoRoadInterstate) = 0.2   objRoute.Waypoints.Item(1).SegmentPreferences = geoSegmentPreferred   objRoute.Calculate
  End Sub

Note  This sample code is specific for use in MapPoint North America; it is for illustration purposes only.