Sub CreateRoutesSingleField() Dim ET As ETGW_Core Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pFeatureLayer As IFeatureLayer Dim pInFeatureClass As IFeatureClass Dim pOutFeatureClass As IFeatureClass Dim sOutFileName As String Set ET = New ETGW_Core Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap Set pFeatureLayer = ET.GetLayer("streets") Set pInFeatureClass = pFeatureLayer.FeatureClass sOutFileName = "c:\00\routes2.shp" '======================================================================= Dim pGDS As IGeoDataset Dim sIdFieldName As String Dim sStart As String Dim bIgnoreGaps As Boolean Dim pOutSRef As ISpatialReference Dim sMessage As String Dim sMFieldName As String sIdFieldName = "StreetCode" 'the field to be used as route identifier sStart = "ll" 'coordinate priority ll = LowerLeft bIgnoreGaps = True 'the spatial gaps will be ignored when creating routes sMFieldName = "METERS" ' the M values will be calculated from the values in the "METERS" field Set pGDS = pInFeatureClass Set pOutSRef = pGDS.SpatialReference 'the output will have the same spatial reference as the input Set pOutFeatureClass = ET.CreateRoutesSingleField(pInFeatureClass, sOutFileName, _ sIdFieldName, sStart, bIgnoreGaps, sMFieldName, pOutSRef, sMessage) '======================================================================== Set pFeatureLayer = New FeatureLayer Set pFeatureLayer.FeatureClass = pOutFeatureClass pFeatureLayer.Name = pOutFeatureClass.AliasName pMap.AddLayer pFeatureLayer End Sub