×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Can I change some coordinates in LWPolyline with VBA

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?

RE: Can I change some coordinates in LWPolyline with VBA

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources