Here is a sub that I wrote that uses determinants of a matrix to get the
direction by setting up columns of the x and y coordinates. It uses a
collection of points but you should be able to modify it to work for
you.
Public Sub ccw()
'dimension locals
Dim PolyPoints As New Collection
Dim PolyCounter As Integer
Dim numPoints As Long
Dim Pnt() As Variant
Dim Pnt1() As Variant
Dim PointCounter As Long
Dim top As Single
Dim bottom As Single
Dim Result As Single
Dim SectionPolyCol As New Collection
'get a polygon point collection from a global collection of polygons
Set SectionPolyCol = gSectionCol.Item(1)
PolyCounter = 1
For Each PolyPoints In SectionPolyCol
numPoints = PolyPoints.Count
top = 0
bottom = 0
Result = 0
For PointCounter = 1 To numPoints - 1
Pnt = PolyPoints.Item(PointCounter)
Pnt1 = PolyPoints.Item(PointCounter + 1)
top = top - (Pnt(1) * Pnt1(0))
bottom = bottom + (Pnt(0) * Pnt1(1))
Next PointCounter
Result = top + bottom
If Result > 0 Then
MsgBox "CounterClockwise"
Else
MsgBox "Clockwise"
End If
PolyCounter = PolyCounter + 1
Next PolyPoints
End Sub
Good Luck,
Bill
--
fazzini wrote:
> Can i get the orientation (CW or CCW) of a polyline.
> My polyline don't have any radius? I cannot use the
> get bulge method. THX to all.