pioptl Posted April 21 Posted April 21 I'm Looking for a Lisp to Uncheck max leader points for all Multileader styles. I've done quite a bit of searching and can't seem to find one. Thanks in advance for any help. Quote
mhupp Posted April 21 Posted April 21 Need a little bit more info maybe a before and after sample drawing of what your looking to do. @SLW210 prob will also be moved to AutoLISP, Visual LISP & DCL 1 Quote
BIGAL Posted April 22 Posted April 22 (edited) Maybe something like this, the item 1 is the second MLSTYLE, need a loop for all. I set style to 4 points then back to 2. use 0 for off. (setq dicts (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object)))) (setq dictObj (vla-Item dicts "acad_mleaderstyle")) (setq dictObj (vla-Item dictobj 1)) ; second style in my test (vla-put-MaxLeaderSegmentsPoints dictobj 2) Edited April 22 by BIGAL 1 Quote
SLW210 Posted April 22 Posted April 22 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum, please post in the correct forum. Wouldn't unchecking that box be the same as setting it to 2? See below for correct answer. Quote
SLW210 Posted April 23 Posted April 23 Just create a new style and add to your templates. Here is a LISP to create a new MLeader style. https://forums.augi.com/showthread.php?148849-Creating-Multileader-Style-using-LISP&p=1224972&viewfull=1#post1224972 Quote
SLW210 Posted April 28 Posted April 28 After quickly looking into this... Unchecking the box is equal to no limit. Had a little time at work so... quickly tested. ;;; Uncheck the Max leader points in the Multileader Style dialog box. (or set a value). | ;;; | ;;; https://www.cadtutor.net/forum/topic/99083-looking-for-lisp-to-uncheck-max-leader-points-for-all-mleader-styles/#findComment-678964 | ;;; | ;;; By SLW210 (a.k.a. Steve Wilson) | ;;; | ;;;*************************************************************************************************************************************| ;;;*************************************************************************************************************************************| (defun c:UnchkMLdrPnts (/ acApp doc dict obj) (vl-load-com) (setq acApp (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acApp)) (setq dict (vla-Item (vla-get-Dictionaries doc) "ACAD_MLEADERSTYLE")) (vlax-for obj dict (if (vlax-property-available-p obj 'MaxLeaderSegmentsPoints) (vla-put-MaxLeaderSegmentsPoints obj 0) ;; 0 = unlimited ) ) (princ "\nMax leader points box is unchecked.") (princ) ) 2 Quote
SLW210 Posted May 1 Posted May 1 OP seems to have disappeared. I would presume it works as the OP wanted. On doing some thinking on the OPs request, though the suggestion of setting up templates and/or using the create a Multileader Style LISP should handle almost everything, seems adding further options to totally update all or specific Multileader Style(s) might be an option. I might just play with this if some think it may have some use. I often get old drawings to redo or update, but usually just use the create a Multileader LISP or import a style, maybe just changing the existing style would be as good or better? Though, someone may know, is it possible to also update existing Multileaders MaxLeaderSegmentsPoints? Quote
dexus Posted May 4 Posted May 4 Nice code SLW210. I did get the error that "acad" is a protected symbol, so its better to use a different name for that one. The code worked fine regardless. We can also do the same thing with entmod: (defun c:unlimitedmleaders (/ e enx) (foreach e (vl-remove-if-not (function (lambda (a) (= (car a) 350))) (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE") ) (setq enx (entget (cdr e))) (entmod (subst '(90 . 0) (assoc 90 enx) enx)) ) (princ) ) 1 Quote
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.