Hi,
Hier Mal eine Lösung die ich im Internet gefunden habe.
Option Explicit
Public Sub testReversePline()
Dim oDoc As AcadDocument, oPline As AcadLWPolyline, vp As Variant
Set oDoc = ThisDrawing
oDoc.Utility.GetEntity oPline, vp, "Pick pline to reverse"
Dim oPline2 As AcadLWPolyline
Dim a As Integer
Dim oBLk As AcadBlock
Set oBLk = oDoc.ObjectIdToObject(oPline.OwnerID)
Dim points
points = oPline.Coordinates
Dim Points2() As Double
ReDim Preserve Points2(0 To UBound(points)) As Double
'create second array of points, last point from the
'selected line first etc.
For a = LBound(points) To UBound(points) Step 2
Points2(a) = points(UBound(points) - a - 1)
Points2(a + 1) = points(UBound(points) - a)
Next
'create new polyline in reversed direction
Set oPline2 = oBLk.AddLightWeightPolyline(Points2)
Dim c As Integer
'create reversed bulges
c = (UBound(points) - 3) / 2
For a = 0 To c
oPline2.SetBulge (c - a), -oPline.GetBulge(a)
Next
'delete original
oPline.Delete
Set oPline2 = Nothing
End Sub
Gruß, Carsten
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP