MapWinGIS:ShapeNetwork MoveTo
From MapWindow GIS
MoveTo
Moves the current shape pointer to the shape specified by the shape index.
VB.NET Usage
Function MoveTo(ShapeIndex As Integer) As Boolean
Parameters
|
ShapeIndex | The shape index of the shape in the network to move the current shape pointer to. |
| ReturnValue | A boolean value representing the success or failure of moving the current shape pointer to the specified shape. |
Sample Code
Private Sub ShapeNetworkMoveTo()
Dim sf As New MapWinGIS.Shapefile()
Dim shapenetwork As New MapWinGIS.ShapeNetwork()
Dim result As Integer, shapeindex As Integer
'Open a line shapefile
sf.Open("C:\test.shp")
'Build a shape network from the shapefile using shape 0 as the outlet shape and point 0 in shape 0 as the outlet point
result = shapenetwork.Build(sf, 0, 0, 10, MapWinGIS.AmbiguityResolution.DISTANCE_TO_OUTLET)
'Set the index of the shape
shapeindex = 2
'Move the shape pointer to the shape specified by the shape index
shapenetwork.MoveTo(shapeindex)
End Sub
VB 6 Usage
Function MoveTo(ShapeIndex As Long) As Boolean
Parameters
|
ShapeIndex | The shape index of the shape in the network to move the current shape pointer to. |
| ReturnValue | A boolean value representing the success or failure of moving the current shape pointer to the specified shape. |
Sample Code
Private Sub ShapeNetworkMoveTo()
Dim sf As New MapWinGIS.Shapefile
Dim shapenetwork As New MapWinGIS.shapenetwork
Dim result As Long, shapeindex As Long
'Open a line shapefile
sf.Open ("C:\test.shp")
'Build a shape network from the shapefile using shape 0 as the outlet shape and point 0 in shape 0 as the outlet point
result = shapenetwork.Build(sf, 0, 0, 10, MapWinGIS.AmbiguityResolution.DISTANCE_TO_OUTLET)
'Set the index of the shape
shapeindex = 2
'Move the shape pointer to the shape specified by the shape index
shapenetwork.MoveTo (shapeindex)
End Sub
















