Sub RandomPointsOnPolyline() Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pFeatureLayer As IFeatureLayer Dim pInFeatureClass As IFeatureClass Dim pOutFeatureClass As IFeatureClass Dim sMessage As String Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap Set pFeatureLayer = pMxDoc.SelectedLayer Set pInFeatureClass = pFeatureLayer.FeatureClass '======================================================================= Dim ET As New ETGW_Core Dim sOutFileName As String Dim sValueField As String Dim lMaxPoints As Long ' The field to get the number of points per polyline sValueField = "Meters" ' Restrict the max number of points per polylines ' if the value for a polyline in the field above is more than the value set below ' the lMaxPoints will be used lMaxPoints = 100 sOutFileName = "c:\00\RandomPointsOnPolyline.shp" Set pOutFeatureClass = ET.RandomPointsOnPolyline(pInFeatureClass, sOutFileName, _ sValueField, lMaxPoints, sMessage) '======================================================================== If pOutFeatureClass Is Nothing Then MsgBox sMessage Else Set pFeatureLayer = New FeatureLayer Set pFeatureLayer.FeatureClass = pOutFeatureClass pFeatureLayer.Name = pOutFeatureClass.AliasName pMap.AddLayer pFeatureLayer End If End Sub