Update all lwpolyline coordinates

Discussion in 'AutoCAD' started by jonp, Apr 11, 2004.

  1. jonp

    jonp Guest

    Hi all

    I need to extract all the coordinates of a lwpolyline, do some recalucation of them and then update the lwpolyline with new coordinates of all points. Does anyone have the solution for this?

    Jon
     
    jonp, Apr 11, 2004
    #1
  2. jonp

    Jeff Mishler Guest

    Yes.
    Something like this:

    (defun mod-poly-coords (/ pline coords newcoords)
    (setq pline (vlax-ename->vla-object (car (entsel)))
    coords (vlax-get pline 'coordinates)
    )
    ;do what you need to with the coords, such as:
    (setq newcoords (mapcar '(lambda (x) (+ 10 x)) coords))
    (vlax-put pline 'coordinates newcoords)
    )

    HTH,
    Jeff

    recalucation of them and then update the lwpolyline with new coordinates
    of all points. Does anyone have the solution for this?
     
    Jeff Mishler, Apr 11, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.