hi
I'm looking LISP, LEADER extend to nearest LINE,POLYLINE.
Thanks
venki
hi
I'm looking LISP, LEADER extend to nearest LINE,POLYLINE.
Thanks
venki
Last edited by klcecity371697; 2012-06-21 at 05:00 AM.
Try this code not sure about if this helps
Select objects with accuracy
~'J'~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) )
"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
Hello! sir
Thank u soooo.. much,works perfect;great works
Thanks
venki
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
This is a very good lisp. Now why can't Autodesk make leader line extend as do lines & polylines?
Stoopid AutoCAD