Hello, I'd like to know if there's a way to get a Selection set of mleaders with more than 1 leader line.
Thanks
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Solved by Kent1Cooper. Go to Solution.
You could get the selection set of all Multileaders, and step through it to keep only those with more than one
(304 . "LEADER_LINE{")
entry in their entity data:
(defun C:MLML (/ n ml mldata mlleaders); = MultiLeader(s) with Multiple Leaders
(setq ss (ssget "_X" '((0 . "MULTILEADER"))))
(repeat (setq n (sslength ss))
(setq
ml (ssname ss (setq n (1- n)))
mldata (entget ml)
mlleaders (vl-remove-if-not '(lambda (x) (equal x '(304 . "LEADER_LINE{"))) mldata)
); setq
(if (<= (length mlleaders) 1) (ssdel ml ss))
); repeat
(sssetfirst nil ss)
); defun
That leaves such MLeaders selected/gripped/highlighted, and also in the ss variable to do whatever you want to them.
Or using the "LeaderLineCount" property...
(defun c:test ()
(if (setq s (ssget '((0 . "MULTILEADER"))))
(repeat (setq i (sslength s))
(setq e (ssname s (setq i (1- i))))
(if (< (getpropertyvalue e "LeaderLineCount") 2)
(ssdel e s))))
(if (and s (> (sslength s) 0)) (sssetfirst nil s))
(princ)
)
@ВeekeeCZ wrote:
Or using the "LeaderLineCount" property...
Interesting.... I wasn't aware of that property, but in looking into it, I mistakenly tried the "LeaderCount" property. That has an unexpected way of looking at things:
If all Leaders hook in at the same place, it only considers it to have 1 -- maybe it should be called "LeaderTieInLocationCount" or something. So be sure to use the one with "Line" in the middle of the property name.
[There is also the interesting difference that "LeaderCount" is available as a VLA property in addition to via the (getpropertyvalue) approach, but "LeaderLineCount" is only in the latter family of properties.]
To be more correct...
I always learn much from you guys and gals. 😏
John F. Uhden
I think "The image doesn't exist" because I wasn't signed in.
I've been shutting down my machine each day before I leave work.
John F. Uhden
@john.uhden wrote:
To be more correct...
I always learn much from you guys and gals. 😏
[Not necessarily a needed correction, in these days when all standards are falling by the wayside. Even between women, though I cringe when I hear it, "you guys" is a common usage. I've been at wedding receptions at which the bride, addressing her all-female bridesmaids, in public, referred to them as "you guys."]
Hmm. I think maybe it's that the image file "Au0tBpk.png" is no longer at imgur.com.
Wonder where it went. ?
John F. Uhden
Maybe I'm out of line, but I still think of BeekeeCZ as a gal, even if her new ID is somewhat hexadecimal looking.
John F. Uhden