Can I change some coordinates in LWPolyline with VBA
Can I change some coordinates in LWPolyline with VBA
(OP)
Can I change certain coordinates of a LWPolyline using VBA? I'm trying to raise certain Y coordinates by 4". I've written the below code which seems like it should work but it doesn't do anything.
For i = LBound(objLWPoly.Coordinates) To UBound(objLWPoly.Coordinates) - 1 Step 2
objLWPoly.Coordinates(i) = objLWPoly.Coordinates(i)
objLWPoly.Coordinates(i + 1) = objLWPoly.Coordinates(i + 1) + (4)
Next
objLWPoly.Update
End If
ThisDrawing.Application.Update
Any ideas on what I'm doing wrong and how to fix it?
For i = LBound(objLWPoly.Coordinates) To UBound(objLWPoly.Coordinates) - 1 Step 2
objLWPoly.Coordinates(i) = objLWPoly.Coordinates(i)
objLWPoly.Coordinates(i + 1) = objLWPoly.Coordinates(i + 1) + (4)
Next
objLWPoly.Update
End If
ThisDrawing.Application.Update
Any ideas on what I'm doing wrong and how to fix it?





RE: Can I change some coordinates in LWPolyline with VBA
Dump the coordinates to a new coordinate array, then assign the coordinate array to the polyline and see if that doesn't fix your problem. The way would be to extract the coordinates, manipulate them, and then create a new polyline...
HTH
Todd