mikewong0719 Posted March 26, 2018 Share Posted March 26, 2018 HELP, does any one have a method or lisp can make multiple leader arrange and match same angle ,because my job need to make a lot of multiple leader arrange ,anyone can suggest solve the problem ?? like from 1 to 2 Quote Link to comment Share on other sites More sharing options...
SLW210 Posted March 26, 2018 Share Posted March 26, 2018 Check the ALIGN option of the Multileader Command. Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted March 27, 2018 Author Share Posted March 27, 2018 but i try multileader algin, how can i change from leader to mleader, i found a lisp can change to mleader , but once time only can change 1 leader to multileader , how can i change all leader to mleader faster because my job need to align over 300 leader and align , this too waste my time Quote Link to comment Share on other sites More sharing options...
ronjonp Posted March 27, 2018 Share Posted March 27, 2018 Give this a try: (defun c:foo (/ _pts a d e el epts i mp n o p p2 s x y) ;; RJP 03.27.2018 ;; Aligns 'old school' 3 pt leaders matching angle of leader and fixes offset distance of horizontal landings ;; ***The bottom most leader is the one matched*** ;; Far from perfect, but better than doing it manually (defun _pts (e) (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= 10 (car x))) (entget e)))) (cond ((and (setq s (ssget ":L" '((0 . "leader")))) (setq s (vl-sort (mapcar '(lambda (x) (append (list x) (_pts x))) (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) ) '(lambda (a b) (< (cadr (last a)) (cadr (last b)))) ) ) (setq d (/ (distance (last (car s)) (last (last s))) (length s))) (or (setq i (getdist (strcat "\nEnter spacing for horizontal leader[<" (vl-princ-to-string d) ">]: ") ) ) (setq i d) ) (setq e (car s)) (setq s (cdr s)) ) (setq a (angle (car (setq epts (cdr e))) (cadr epts))) (setq y (last epts)) (setq n 1) (foreach l s (setq o (vlax-ename->vla-object (car l))) (setq p (cdr l)) (cond ((setq mp (inters (car p) (polar (car p) a 1e-2) (setq p2 (list (car y) (+ (* n i) (cadr y)) 0.0)) (polar p2 0.0 1e-2) nil ) ) (vlax-put o 'coordinates (apply 'append (list (car p) mp p2))) (setq n (1+ n)) ) ) ) ) ) (princ) )(vl-load-com) 1 Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted March 28, 2018 Author Share Posted March 28, 2018 this lisp i try, it can set the spacing same, but i don't know how to set angle, anyone can help me, PLEASE Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted March 28, 2018 Author Share Posted March 28, 2018 my drawing is like to this drawing , many cbw need to show, how can i align angle and heignt all leader easily 1 Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted March 28, 2018 Author Share Posted March 28, 2018 when i use foo.lisp, it will be like to 4.jpeg how can i know it is follow which leader is buttom?? new.dwg Quote Link to comment Share on other sites More sharing options...
ronjonp Posted March 28, 2018 Share Posted March 28, 2018 Put your bottom label how you want it. Then select all above to match. Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted March 28, 2018 Author Share Posted March 28, 2018 my drawing leader now can align, but leader have a block or text need to algin ,any method can make block align leader Quote Link to comment Share on other sites More sharing options...
ronjonp Posted March 28, 2018 Share Posted March 28, 2018 my drawing leader now can align, but leader have a block or text need to algin ,any method can make block align leader Post a sample drawing. Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted March 28, 2018 Share Posted March 28, 2018 See also: http://forums.augi.com/showthread.php?171528-hello-does-any-one-have-a-method-or-lisp-can-make-multiple-leader-arrange-and-match-same-angle Quote Link to comment Share on other sites More sharing options...
ronjonp Posted March 28, 2018 Share Posted March 28, 2018 See also: http://forums.augi.com/showthread.php?171528-hello-does-any-one-have-a-method-or-lisp-can-make-multiple-leader-arrange-and-match-same-angle Gotta love the forum spammers.... Quote Link to comment Share on other sites More sharing options...
Grrr Posted March 28, 2018 Share Posted March 28, 2018 Gotta love the forum spammers.... (_CreateNewThread "hello ,does any one have a method or lisp can make multiple leader arrange and match same angle") (foreach x '("hello, does any one have a method or lisp can make multiple leader arrange and match same angle ,because my job need to make a lot of multiple leader arrange ,anyone can suggest solve the problem ?? \nTHX" "Multiple need same angle same height,does anyone have a method?" "my drawing is like to this drawing , many cbw need to show, how can i align angle and heignt all leader easily" "bump" "bump" "bump" ) (_PostReply x) ); foreach Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted March 29, 2018 Author Share Posted March 29, 2018 my drawing is like to this one, i need a lisp or method to finish my job, please help me 7.dwg Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted June 19, 2018 Author Share Posted June 19, 2018 hello, any one can help me make multiple leader match same angle, because i have a lot of leader but leader angle not same , but my job need to arrange all leader make same angle, how can i do ??I only need same angle, no need same height THX Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted June 19, 2018 Author Share Posted June 19, 2018 (edited) in other post, i found this lisp, but i only need same angle, no need same height, but i don't know how to change this lisp, anyone can help me, pls Code: --------- (defun c:foo (/ _pts a d e el epts i mp n o p p2 s x y) ;; RJP 03.27.2018 ;; Aligns 'old school' 3 pt leaders matching angle of leader and fixes offset distance of horizontal landings ;; ***The bottom most leader is the one matched*** ;; Far from perfect, but better than doing it manually (defun _pts (e) (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= 10 (car x))) (entget e)))) (cond ((and (setq s (ssget ":L" '((0 . "leader")))) (setq s (vl-sort (mapcar '(lambda (x) (append (list x) (_pts x))) (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) ) '(lambda (a b) (< (cadr (last a)) (cadr (last b)))) ) ) (setq d (/ (distance (last (car s)) (last (last s))) (length s))) (or (setq i (getdist (strcat "\nEnter spacing for horizontal leader[<" (vl-princ-to-string d) ">]: ") ) ) (setq i d) ) (setq e (car s)) (setq s (cdr s)) ) (setq a (angle (car (setq epts (cdr e))) (cadr epts))) (setq y (last epts)) (setq n 1) (foreach l s (setq o (vlax-ename->vla-object (car l))) (setq p (cdr l)) (cond ((setq mp (inters (car p) (polar (car p) a 1e-2) (setq p2 (list (car y) (+ (* n i) (cadr y)) 0.0)) (polar p2 0.0 1e-2) nil ) ) (vlax-put o 'coordinates (apply 'append (list (car p) mp p2))) (setq n (1+ n)) ) ) ) ) ) (princ) ) Edited June 20, 2018 by rkmcswain Added [CODE] tags Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted June 19, 2018 Share Posted June 19, 2018 Try this, but it's untested... And I don't think it will be applicable for example picture you provided... Please post the code in code tags next time : [noparse] Your code here... [/noparse] (defun c:foo ( / mtchleader ss a i lea p1 p2 p3 mp ) (vl-load-com) (while (or (not (setq mtchleader (car (entsel "\nPick matching leader - matching angle of this leader is reference angle for all other leaders...")))) (if mtchleader (/= (cdr (assoc 0 (entget mtchleader))) "LEADER") ) ) (prompt "\nMissed or picked wrong entity type...") ) (while (or (prompt "\nSelect leaders to match...") (not (setq ss (ssget "_:L" '((0 . "LEADER"))))) ) (prompt "\nEmpty sel.set...") ) (setq a (angle (cdr (assoc 10 (entget mtchleader))) (cdr (assoc 10 (cdr (member (assoc 10 (entget mtchleader)) (entget mtchleader))))))) (if (ssmemb mtchleader ss) (ssdel mtchleader ss) ) (repeat (setq i (sslength ss)) (setq lea (ssname ss (setq i (1- i)))) (setq p1 (cdr (assoc 10 (entget lea)))) (setq p2 (cdr (assoc 10 (cdr (member (assoc 10 (entget lea)) (entget lea)))))) (setq p3 (cdr (assoc 10 (reverse (entget lea))))) (setq mp (inters p1 (polar p1 a 1e-2) p2 p3 nil)) (vla-put-coordinates (vlax-ename->vla-object lea) (apply 'append (list p1 mp p3))) ) (princ) ) Regards, M.R. HTH. Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted June 20, 2018 Author Share Posted June 20, 2018 Try this, but it's untested... And I don't think it will be applicable for example picture you provided...Please post the code in code tags next time : [noparse] Your code here... [/noparse] (defun c:foo ( / mtchleader ss a i lea p1 p2 p3 mp ) (vl-load-com) (while (or (not (setq mtchleader (car (entsel "\nPick matching leader - matching angle of this leader is reference angle for all other leaders...")))) (if mtchleader (/= (cdr (assoc 0 (entget mtchleader))) "LEADER") ) ) (prompt "\nMissed or picked wrong entity type...") ) (while (or (prompt "\nSelect leaders to match...") (not (setq ss (ssget "_:L" '((0 . "LEADER"))))) ) (prompt "\nEmpty sel.set...") ) (setq a (angle (cdr (assoc 10 (entget mtchleader))) (cdr (assoc 10 (cdr (member (assoc 10 (entget mtchleader)) (entget mtchleader))))))) (if (ssmemb mtchleader ss) (ssdel mtchleader ss) ) (repeat (setq i (sslength ss)) (setq lea (ssname ss (setq i (1- i)))) (setq p1 (cdr (assoc 10 (entget lea)))) (setq p2 (cdr (assoc 10 (cdr (member (assoc 10 (entget lea)) (entget lea)))))) (setq p3 (cdr (assoc 10 (reverse (entget lea))))) (setq mp (inters p1 (polar p1 a 1e-2) p2 p3 nil)) (vla-put-coordinates (vlax-ename->vla-object lea) (apply 'append (list p1 mp p3))) ) (princ) ) Regards, M.R. HTH. this lisp doesn't work, anyone can help me, PLS Quote Link to comment Share on other sites More sharing options...
zixuan203344 Posted June 20, 2018 Share Posted June 20, 2018 this lisp doesn't work, anyone can help me, PLS Replace this (vla-put-coordinates (vlax-ename->vla-object lea) (apply 'append (list p1 mp p3))) with (vlax-put (vlax-ename->vla-object lea) 'coordinates (apply 'append (list p1 mp p3))) Quote Link to comment Share on other sites More sharing options...
mikewong0719 Posted June 20, 2018 Author Share Posted June 20, 2018 (edited) NOW THIS LISP IS WORK , BUT ONLY CAN MAKE ANGLE ,BUT LEADER SECOND LINE HAVE A PROBLEM , HOW CAN SOLVE?? pls (defun c:foo ( / mtchleader ss a i lea p1 p2 p3 mp ) (vl-load-com) (while (or (not (setq mtchleader (car (entsel "\nPick matching leader - matching angle of this leader is reference angle for all other leaders...")))) (if mtchleader (/= (cdr (assoc 0 (entget mtchleader))) "LEADER") ) ) (prompt "\nMissed or picked wrong entity type...") ) (while (or (prompt "\nSelect leaders to match...") (not (setq ss (ssget "_:L" '((0 . "LEADER"))))) ) (prompt "\nEmpty sel.set...") ) (setq a (angle (cdr (assoc 10 (entget mtchleader))) (cdr (assoc 10 (cdr (member (assoc 10 (entget mtchleader)) (entget mtchleader))))))) (if (ssmemb mtchleader ss) (ssdel mtchleader ss) ) (repeat (setq i (sslength ss)) (setq lea (ssname ss (setq i (1- i)))) (setq p1 (cdr (assoc 10 (entget lea)))) (setq p2 (cdr (assoc 10 (cdr (member (assoc 10 (entget lea)) (entget lea)))))) (setq p3 (cdr (assoc 10 (reverse (entget lea))))) (setq mp (inters p1 (polar p1 a 1e-2) p2 p3 nil)) (vlax-put (vlax-ename->vla-object lea) 'coordinates (apply 'append (list p1 mp p3))) ) (princ) ) Edited June 20, 2018 by rkmcswain Added [CODE] tags Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.