Allright, allright, my mistake - here's the coded answer (more or less): It
solves LWPlines with line segments only - no arcs included. Also no error
trapping of any kind. Pass the function the LWPline length (search the code
down the NG) divided by 2 and the LWPline itself.
'===========================================================================
====
' Stationery point along LWPolyline
' Input: polyline length/2 and polyline itself
' Result: forced 2D point (three element array of doubles)
'===========================================================================
====
Function StacionazaTacka(valStacionaza As Double, obj As AcadLWPolyline) As
Variant
Dim Coords As Variant
Dim UBnd As Long
Dim PntA(0 To 2) As Double
Dim PntB(0 To 2) As Double
Dim PntX As Variant
Dim RunDist As Double
Dim DistAB As Double
Dim i as Long
RunDist = 0
DistAB = 0
Coords = obj.Coordinates
UBnd = UBound(Coords)
i = 0
Do While True
PntA(0) = Coords(i): PntA(1) = Coords(i + 1): PntA(2) = 0
PntB(0) = Coords(i + 2): PntB(1) = Coords(i + 3): PntB(2) = 0
DistAB = XYDistance(PntA, PntB)
PrevDist = RunDist
RunDist = RunDist + DistAB
If RunDist >= valStacionaza Then
ugao = ThisDrawing.Utility.AngleFromXAxis(PntA, PntB)
Razlika = DistAB - (RunDist - valStacionaza)
PntX = ThisDrawing.Utility.PolarPoint(PntA, ugao, Razlika)
StacionazaTacka = Array(PntX(0), PntX(1), 0#)
Exit Do
End If
If i + 2 > UBnd Then
StacionazaTacka = Array(0#, 0#, 0#)
Exit Do
Else
i = i + 2
End If
Loop
End Function
"Frank Oquendo" wrote in message
news:40a81f18$1_1@newsprd01...
> Maksim Sestic wrote:
> > Or simply find the polyline's midst segment, then find the mid point
> > of that segment. Pure VBA.
>
> And if a polyline has an even number of segments?
>
> Besides, what makes you think these classes are not pure VBA?
>
> --
> Gravity: it's not just a good idea, it's the law.
>
>