Open Table of Contents

ET GeoWizards Scripting

RandomPointsOnPolyline
(Go to the main page of the function)

Generates random points located on the polylines of the input polyline dataset. The number of points per polyline can be constant or different for each polyline - based on the values in a numeric field of the input polyline feature class.

Syntax    

Dim ET As  New ETGW_Core
Set variable =  ET.RandomPointsOnPolyline(pInFeatureClass, sOutFileName, sValueField, lNumberPoints, sMessage)

The RandomPointsOnPolyline method syntax has the following object qualifier and arguments:

Part Description
variable An IFeatureClass object
pInFeatureClass Required. An IFeatureClass object (Must be a Polyline feature class)
sOutFileName Required. A String - the full name of the output feature class (A feature class with the same full name should not exist)
sValueField Required. A numeric field which values will be used to get the number of points to be generated per polyline. If you want to use a constant number of points per polyline set sValueField = ""
lNumberPoints Required. A number that is used in two ways
  • If a sValueField is specified,  lNumberPoints is used as maximum points allowed per polyline
  • If a sValueField is an empty string, lNumberPoints is used as a constant that define the number of  points to be generated per polyline
sMessage Optional. In a case of failure -  description of the cause. If the functions completes with success an empty string will be returned. 

Example