K Baden Posted August 2, 2017 Share Posted August 2, 2017 Good afternoon all! I am looking for a code that will replace leaders of one style with a leader of a different style. See attached test drawing for clarity. As you can see the top leader is a 2 point leader, but with a set leg. This is how i want all my leaders to be. Just below that is a leader with 3 points, I DO NOT want this on my drawings anymore. moving text around with this type of leader drags the leg with the text, but has anotherpoint that stays. This is endlessly infuriating. I've done a bunch of searches but have had no luck. can anyone help me out? leaderTESTdrawing.dwg Quote Link to comment Share on other sites More sharing options...
ronjonp Posted August 2, 2017 Share Posted August 2, 2017 Have you thought about using mleaders? IMO they are far easier to manipulate than old school leaders. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted August 2, 2017 Share Posted August 2, 2017 This seems to fix the 3 point leader .. limited testing. (defun c:foo (/ ss) (if (setq ss (ssget ":L" '((0 . "leader")))) (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (entmod (mapcar '(lambda (x) (cond ((= 75 (car x)) '(75 . 1)) ((= 40 (car x)) '(40 . 0.0)) ((= 41 (car x)) '(41 . 0.0)) (x) ) ) (entget x) ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
K Baden Posted August 3, 2017 Author Share Posted August 3, 2017 This is AWESOME! Is there any way i can get it to select all the leaders automatically? Quote Link to comment Share on other sites More sharing options...
ronjonp Posted August 3, 2017 Share Posted August 3, 2017 This is AWESOME! Is there any way i can get it to select all the leaders automatically? Change: (setq ss (ssget ":L" '((0 . "leader")))) to (setq ss (ssget [b][color="red"]"_X"[/color] [/b]'((0 . "leader")))) Quote Link to comment Share on other sites More sharing options...
K Baden Posted August 3, 2017 Author Share Posted August 3, 2017 Works Beautifully! Thanks a ton!! Quote Link to comment Share on other sites More sharing options...
ronjonp Posted August 3, 2017 Share Posted August 3, 2017 Works Beautifully! Thanks a ton!! Glad to help Quote Link to comment Share on other sites More sharing options...
K Baden Posted August 3, 2017 Author Share Posted August 3, 2017 the only problem im encountering with this is that certain leaders go to 2 point leaders without the little leg out. Any idea how to mend that? I hate that all leaders in autocad are described as "Leader" regardless of these things. Not sure how to even pinpoint. basically, this works great on 3 vertex leaders that maintain the leg when you move it. This does not work on 3 point leaders that the leg is dependent on the position of the second and third point, and if one moves, the leg does not automatically generate. Not sure if im being clear. Hopefully I am. I can probably post another test drawing if you need it with the leaders im talking about 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.