Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I change some coordinates in LWPolyline with VBA

Status
Not open for further replies.

jrice174

Civil/Environmental
Nov 8, 2004
129
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?
 
Replies continue below

Recommended for you

Hi jrice174,

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor