Open Table of Contents

ET GeoWizards Scripting

Snap Polylines
(Go to the main page of the function)

Snaps the features of a polyline feature class  to the features of another dataset (Point, Polyline or Polygon)

Syntax    

Dim ET As  New ETGW_Core
Set variable = 
ET.SnapPolylines(pInFeatureClass , pReferenceFeatureClass, _
                            sOutFileName, dSnapTol, bVertex, bNearest, sSnapWhat, sMessage)

The SnapPolylines 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)
pReferenceFeatureClass Required. An IFeatureClass object (a Point, Polyline or Polygon 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)
dSnapTol Required. A Double representing the snap tolerance
bVertex Required. A Boolean indicating whether snapping to the closest vertex of the nearest feature from the pReferenceFeatureClass to be used
bNearest Required. A Boolean indicating whether snapping to the nearest point of the nearest feature from the pReferenceFeatureClass to be used
sSnapWhat Required. A String indicating what parts of the input polylines will be snapped. Possible values:
  • Nodes: Only nodes (end points) of the polylines will be snapped
  • Vertex: All the vertices of the source polylines will be used.
  • Insert: This option will get the vertices from the features of the pReferenceFeatureClass  and will insert new vertices into the source polylines. The new vertices together with the original ones will be used for snapping. This option is slower than the other ones, but gives the best snapping results especially if the polylines to be snapped have much less vertices than the ones from the pReferenceFeatureClass .
sMessage Optional. In a case of failure -  description of the cause. If the functions completes with success an empty string will be returned. 

Example