TheyCallMeJohn Posted December 28, 2010 Posted December 28, 2010 Okay so I have to purge our drawings a lot and we have some multileader styles that are rarely used. So I am trying to create a lisp with an "if" statement that checks to see if the mleaderstyle exists. If it exists it will proceed with drawing the lisp but if it does not exist it will insert a block with the style then proceed with the rest of the actions. Can anyone help me with an example of an if statement that would work for this? I have been searching for quite a while with little success. Thanks you, J Quote
Lee Mac Posted December 28, 2010 Posted December 28, 2010 Something like this perhaps: (defun LM:MLeaderStylep ( style ) (and (setq dict (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE")) (dictsearch (cdr (assoc -1 dict)) style) ) ) Returns T if style argument is an MLeaderStyle, else nil. (LM:MLeaderStylep "Standard") Quote
chulse Posted July 25, 2023 Posted July 25, 2023 (edited) On 12/28/2010 at 1:06 PM, Lee Mac said: Something like this perhaps: (defun LM:MLeaderStylep ( style ) (and (setq dict (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE")) (dictsearch (cdr (assoc -1 dict)) style) ) ) Returns T if style argument is an MLeaderStyle, else nil. (LM:MLeaderStylep "Standard") I realize this is an old thread, but thanks Lee for yet another one. Your subfunctions really make life easy. Edited July 25, 2023 by chulse Quote
Lee Mac Posted August 6, 2023 Posted August 6, 2023 On 7/25/2023 at 8:57 PM, chulse said: I realize this is an old thread, but thanks Lee for yet another one. Your subfunctions really make life easy. You're welcome! I'm glad it helped! 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.