Results 1 to 5 of 5

Thread: leader EXTEND TO LINE,POLYLINE LISP

  1. #1
    Member
    Join Date
    2011-07
    Posts
    13

    Default leader EXTEND TO LINE,POLYLINE LISP

    hi

    I'm looking LISP, LEADER extend to nearest LINE,POLYLINE.


    Thanks
    venki
    Attached Files Attached Files
    Last edited by klcecity371697; 2012-06-21 at 05:00 AM.

  2. #2
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,217

    Default Re: leader EXTEND TO LINE,POLYLINE LISP

    Try this code not sure about if this helps
    Select objects with accuracy

    Code:
    (defun C:EXTL(/ ang coords en ent ipts leadobj plen plent plobj pt pt1 pt2 ptlist pts x xline xlobj)
    (vl-load-com)
    (while
      (setq ent (entsel "\nSelect Leader (press Enter to exit) : "))
       (setq en	 (car ent)
    	 pt	 (cadr ent)
    	 leadobj (vlax-ename->vla-object en))
       (setq coords	(vl-remove-if
    		  'not
    		  (mapcar '(lambda (x)
    			     (if (eq 10 (car x))
    			       (cdr x)))
    			  (entget en))))
       (setq pt1 (car coords)
    	 pt2 (cadr coords)
    	 ang (angle pt1 pt2)
    	 )
       (entmakex (list '(0 . "XLINE")
    		   '(100 . "AcDbEntity")
    		   '(100 . "AcDbXline")
    		   (cons 8 "0")
    		   (cons 10 pt1)
    		   (cons 11 (polar '(0 0) ang 1))
    		   )
    	     )
    
       (setq xline (entlast)
    	 xlobj (vlax-ename->vla-object xline))
    
       (setq plent (entsel "\nSelect the line to extend the leader to: "))
    
       (setq plen  (car plent)
    	 plobj (vlax-ename->vla-object plen))
       (setq ipts (vla-intersectwith xlobj plobj acextendnone))
       (setq pts (vlax-safearray->list (vlax-variant-value ipts)))
       (while (caddr pts)
         (setq ptlist (cons (list (car pts) (cadr pts) (caddr pts)) ptlist))
         (setq pts (cdddr pts)))
       (setq pt (car ptlist))
       (vla-put-coordinate leadobj 0 (vlax-3d-point pt))
       (entdel xline)
       (setq ptlist nil))
      (princ)
      )
    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  3. #3
    Member
    Join Date
    2011-07
    Posts
    13

    Default Re: leader EXTEND TO LINE,POLYLINE LISP

    Hello! sir

    Thank u soooo.. much,works perfect;great works

    Thanks
    venki

  4. #4
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,217

    Default Re: leader EXTEND TO LINE,POLYLINE LISP

    You're welcome, Venki
    Cheers

    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  5. #5
    Member
    Join Date
    2006-02
    Posts
    3

    Default Re: leader EXTEND TO LINE,POLYLINE LISP

    This is a very good lisp. Now why can't Autodesk make leader line extend as do lines & polylines?

    Stoopid AutoCAD

Similar Threads

  1. Need Lisp to Extend all lines
    By mikehaff in forum AutoLISP
    Replies: 10
    Last Post: 2011-12-20, 02:03 AM
  2. Trim or extend line to line - dynamic block
    By janandraczko in forum Dynamic Blocks - Technical
    Replies: 4
    Last Post: 2009-03-01, 11:33 PM
  3. OFFSET and EXTEND USING LISP
    By drsvsmani in forum AutoLISP
    Replies: 2
    Last Post: 2008-05-12, 06:55 AM
  4. Replies: 3
    Last Post: 2007-05-23, 11:44 AM
  5. Replies: 5
    Last Post: 2007-03-13, 02:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •