Community
I write this loop for enlarging selected polylines to enlarge their area. when I select one polyline, I don't have any problems but when I select many polylines, the enlarged polylines (magenta color polyline) displaced on x-axis My code is here:
If ClosedPolyNumber > 0 Then
For j = 0 To UBound(arClosePolyline)
BaseScalPnt(0) = arClosePolyline(j, 0)
BaseScalPnt(1) = arClosePolyline(j, 1)
BaseScalPnt(2) = 0 DeltaArea = 0.1
AreaRatio = 1
up = UBound(arClosePolyline(j, 4))
arCPolyPnts = arClosePolyline(j, 4)
ReDim Preserve arPolyRPnts(up + (up + 1) / 2) k = 0
For i = 0 To UBound(arCPolyPnts) Step 2
arPolyRPnts(3 * k) = arCPolyPnts(i)
k = k + 1 Next k = 0
For i = 1 To UBound(arCPolyPnts) Step 2
arPolyRPnts(3 * k + 1) = arCPolyPnts(i)
arPolyRPnts(3 * k + 2) = 0
k = k + 1
Next
Set curves(j) = ThisDrawing.ModelSpace.AddPolyline(arPolyRPnts)
Do While DeltaArea < 1.2
curves(j).ScaleEntity BaseScalPnt, AreaRatio DeltaArea = curves(j).Area / arClosePolyline(j, 3)
If DeltaArea < 1.2 Then
AreaRatio = AreaRatio + 0.01
End If
Loop
curves(j).Update
Erase arPolyRPnts()
Erase arPolyPnts()
Next
End If
I reformatted what you posted, but it won't run as is. Please post your code using the link in my signature. You can edit your first post by clicking on the 3 vertical dots and choosing "Edit Reply". Post all your code for the command.
Can't find what you're looking for? Ask the community or share your knowledge.