leader vertex

Discussion in 'AutoCAD' started by amper, Aug 19, 2005.

  1. amper

    amper Guest

    Hopefully this is an easy question...

    I have a drawing created a number of years ago by a now out-of-business
    office. It is being reworked and dimensions/leaders are all ready in
    place but in some instances I would like to add an extra vertex in a
    leader. Without erasing and recreating the leader and text, can I
    simply insert a vertex as if the leader was a polyline?

    any help greatly appriecated..

    Regards,

    Kirk
     
    amper, Aug 19, 2005
    #1
  2. amper

    Jeff Guest

    Here's a little lisp routine that will add as many as you like. For splined
    leaders it must set them to straight segments first, but they are restored
    to splines when done.

    (defun c:ldr-vtx-add (/ coords n newcoords obj param pt ss test)
    (vl-load-com)
    (vla-startundomark (vla-get-activedocument (vlax-get-acad-object)))
    (while (setq ss (ssget ":S" '((0 . "LEADER"))))
    (setq obj (vlax-ename->vla-object (ssname ss 0)))
    (cond ((= (setq test (vla-get-type obj)) 1)
    (vla-put-type obj 0)
    (princ "\n....temporarily straightening Leader...")
    )
    ((= test 3)
    (vla-put-type obj 2)
    (princ "\n....temporarily straightening Leader...")
    )
    )
    (while (setq pt (getpoint "\nNew vertex location: "))
    (setq coords (vlax-get obj 'coordinates)
    param (fix (vlax-curve-getparamatpoint obj
    (vlax-curve-getclosestpointto obj pt))
    )
    n -1
    newcoords nil
    )
    (while (<= (setq n (1+ n)) param)
    (setq newcoords (append newcoords (list (car coords)(cadr coords)(caddr
    coords)))
    coords (cdddr coords))
    )
    (setq newcoords (append newcoords pt)
    newcoords (append newcoords coords)
    )
    (vlax-put obj 'coordinates newcoords)
    )
    (if (or (= test 1)
    (= test 3))
    (progn
    (princ "\n....restoring spline Leader...")
    (vla-put-type obj test)
    )
    )
    )
    (vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
    (princ)
    )
     
    Jeff, Aug 19, 2005
    #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.