Share via


SegmentDirections property

Returns the Directions collection for the segment of the route that begins with the specified waypoint and ends with the direction before the next waypoint. If the IsCalculated property of the Route object is False, an empty Directions collection is returned. Read-only.

Applies to

Objects:  Waypoint

Syntax

object.SegmentDirections

Parameters

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

Example

    Sub DirectionsInFirstLegOfRoute()

  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   With objRoute.Waypoints     .Add objMap.FindResults("Seattle, WA").Item(1)     .Add objMap.FindResults("Tacoma, WA").Item(1)     .Add objMap.FindResults("Redmond, WA").Item(1)   End With
  'Get the segment directions for first segment of route   '  and output number of directions in this first segment   objRoute.Calculate   MsgBox "Number of directions in first segment of route: " _     + CStr(objRoute.Waypoints.Item(1).SegmentDirections.Count)
  End Sub

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