TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cyclops on April 09, 2021, 10:18:54 AM

Title: Multi-leaders without leaders..
Post by: cyclops on April 09, 2021, 10:18:54 AM
Help,
Is there lisp that can find Multi-leaders without leaders, then explode them?
Thank
Cy :tickedoff:
Title: Re: Multi-leaders without leaders..
Post by: ronjonp on April 09, 2021, 11:52:06 AM
Maybe this to get the selection:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:foo (/ s)
  2.   (if (setq s (ssget "_X" '((0 . "MULTILEADER"))))
  3.     (progn (foreach e (mapcar 'cadr (ssnamex s))
  4.              (or (vl-catch-all-error-p
  5.                    (vl-catch-all-apply 'vla-getleaderindex (list (vlax-ename->vla-object e) 0))
  6.                  )
  7.                  (ssdel e s)
  8.              )
  9.            )
  10.            (sssetfirst nil s)
  11.     )
  12.   )
  13.   (princ)
  14. )